Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a list of tickets with FogBugz API

Tags:

fogbugz

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

like image 903
Rodger Cooley Avatar asked Mar 19 '09 18:03

Rodger Cooley


1 Answers

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 protected]&password=SecretPwd

You can then do the search:

https://example.fogbugz.com/api.asp?cmd=search&q=correspondent:[email protected]&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:[email protected]".

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.

like image 64
ianmjones Avatar answered Oct 01 '22 04:10

ianmjones