pythonpython-3.xzendeskzendesk-api

Filter for specific tags on Zendesk API using Zenpy on python


Need some help, while trying to retrieve some tickets with Zenpy, I encounter that when I search for more than one tag, they fetch all the data related to both tags, is there a way to filter only for the tickets who have both tags?

An example of my script is:

zenpy_client.search(tags = ["tag1","tag2"], created_between=[to_date, from_date], type='ticket', minus='negated')

Could you help on that? Thanks


Solution

  • You should combine the tags in a string as follows:

    zenpy_client.search(tags = "tag1 tag2", created_between=[to_date, from_date], type='ticket', minus='negated')
    

    Same way you would search in the UI. See this article.