英文:
Filter for specific tags on Zendesk API using Zenpy on python
问题
需要一些帮助,当我尝试使用Zenpy检索一些票据时,我发现当我搜索多个标签时,它们会获取与两个标签相关的所有数据,有没有办法只筛选出具有两个标签的票据?
我的脚本示例如下:
zenpy_client.search(tags = ["tag1","tag2"], created_between=[to_date, from_date], type='ticket', minus='negated')
你能帮助解决这个问题吗?谢谢
英文:
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
答案1
得分: 1
你应该将标签组合成一个字符串,如下所示:
zenpy_client.search(tags="tag1 tag2", created_between=[to_date, from_date], type='ticket', minus='negated')
与在用户界面中搜索的方式相同。请参阅此文章。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论