Getting a list of tickets with FogBugz API

て烟熏妆下的殇ゞ 提交于 2019-12-12 07:51:46

问题


I have a .NET web app that utilizes the FogBugz API to write problem tickets to our FB server... it uses the new command and... among all the other attributes... uses the sCustomerEmail argument to send the user's e-mail with the ticket.

My question is this: Is there a way that I can get a list (via the API, of course) of all tickets assigned to this e-mail? We're wanting to write another page that is a report of what tickets are currently assigned to this e-mail. We don't want to have to create FB accounts for every user out there.

I maybe see hints in the API docs but nothing concrete.

Thanks for any suggestions


回答1:


Yes, you need to send a custom search to the API, passing in the email address as the correspondent axis.

So, once you've got a logon token:

https://example.fogbugz.com/api.asp?cmd=logon&email=jdoe@example.com&password=SecretPwd

You can then do the search:

https://example.fogbugz.com/api.asp?cmd=search&q=correspondent:customer@client.com&cols=ixBug,correspondent,sTicket,sTitle,dtOpened&token=cc83o7ri9c49t4vfvm3bn252ljvp23

Here I passed in a "q" parameter to the search command to set the search axis as "correspondent:customer@client.com".

I also specified a number of columns I want to get back, such as the case number (ixBug), the correspondent's email address (I like to verify things like this), the ticket id the customer got as a response (sTicket, I wasn't sure whether this was what you wanted or the case number), the title (sTitle) and the date the case was opened (dtOpened).

Technically you don't need to ever ask for the ixBug column as it's always available as an attribute of each case element returned in the xml, but sometimes it's easier to have these things as an element.

There are lots of different search axis you can use, and many columns you can return.

Check out the search reference and the sample xml payloads at the botom of the API reference.




回答2:


Probably might be better asking this directly to FB support or on their forums...



来源:https://stackoverflow.com/questions/663462/getting-a-list-of-tickets-with-fogbugz-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!