API, possible to sort tickets?
I would like to use the API to pull recently modified/updated tickets (they appear to be sorted by date created). I cant find anything in the API documentation or support forums but is this possible?
3 people have this question
I have the same issue
By default, the query that is used to return a list of tickets will fetch tickets based on created time . You could have a custom filter that will display the last updated tickets in the list view and then perform the API query to obtain the list of tickets based on this filter.
Create a custom filter as described in the screenshot below :
You could use the following query to obtain the list of tickets based on this filter.
curl -u firstname.lastname@example.org:test -H "Content-Type: application/json" -X GET http://domain.freshdesk.com/helpdesk/tickets//helpdesk/tickets/view/[view_id]?format=json?format=json&page=1
Thanks for your reply =)
I figure this out by requesting all tickets, then by sorting them after with a loop because the script I'm making has to be automatic, so I can't create custom filter graphically.
And I can't create a custom filter with the API, right ?
@Elo : Unfortunately,only the data can be fetched from the pre-defined views using API but it is not possible to create a view on the fly.
@John : There's no explicit option to achieve this ( We're working on this enhancement ) . However, as a workaround you can create multiple observer rules to achieve this. Watch out for the email that helps you to set this up :)
@Aravind S: please send me the workaround solution to view only "customer responded" tickets as I have the same requirement to John. Thanks!
I've just emailed you the workaround. Let me know if you need any further assistance.