使用Python上的Zenpy筛选Zendesk API上的特定标签

huangapple go评论65阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年2月13日 23:04:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75437636.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定