PDA

View Full Version : How to get tickets assigned to users


mrbean26
March 5th, 2016, 10:59 PM
I am trying to use the C# API to get the tickets assigned to users but having hard time tying the account_rec_id with ticket search. Can you please help me with this. Here's what I want.

Get all tickets assigned to Emma Thomas

I believe I would first have to search the Accounts table --> what should be my search criteria on account table?

ObjectQuery<Account> accountSearch = new ObjectQuery<Account>();
accountSearch.AddCriteria(Account.Fields.FileAs, OperatorEnum.opEqual, "Emma Thomas");
accountSearch.FetchObjects(Account.Fields.AccountR EC_ID.Key);

I think post that, I would need to use the account_rec_id from my query above to query the tickets table? Am I right about this?

ObjectQuery<Ticket> ticketSearch = new ObjectQuery<Ticket>(LinkEnum.linkAND, fetch_rcds);
ticketSearch.AddCriteria(Ticket.Fields.AccountREC_ ID, OperatorEnum.opEqual, account.AccountREC_ID);
ticketSearch.FetchObjects();

Support Team
March 7th, 2016, 06:08 AM
Yes, you need the staff recid in order to assign tickets to employees.

Please contact our support by email (support@...) in order to register the relevant contact details for further API support.