Advanced filter options for the Freshservice Tickets API

Hi Team,

One of the Freshservice customers wanted to understand whether the API supports the below filter which includes NOT IN, LIKE, etc.

WHERE
Status NOT IN (‘Resolved’,‘Closed’, ‘Cancelled’)
AND OwnerTeamValue = ‘Retail Systems Operations’
AND (Owner IS NULL OR Owner = ‘’)
AND Category = ‘Mainframe Batch’
AND SubCategory = ‘Auto Alert’
AND Subject LIKE ‘%Subscription/Import%’
AND Type=‘Incident’

I already reviewed below API documentation, but couldn’t find any way to filter the tickets the way the customer is looking for. Please let me know if any alternative way to support this ask from the customer.

https://api.freshservice.com/#filter_tickets

Hmm…

I tried my bit to construct with API query myself. I wasn’t able to due to following reasons

  • I am not aware of what of the above were custom fields
  • Also, I struggled to negate Status NOT IN(..) with support AND and OR only.

I put you in touch with the Freshservice team, where you can follow up with them.

Let us know if you happen to find a solution :slight_smile:

Thank you!

It sounds like API doesn’t support NOT IN(…) and LIKE operators. Anyway, I will wait for the response from the Freshservice team. Meanwhile, I have proposed the below workaround to the customer

/api/v2/tickets/filter?query="agent_id :< 1 AND (status : 2 OR status : 3 OR status : 6 OR status : 7 OR status : 10) AND group_id:52000087584 AND business_unit:'IT' AND created_at:>'2022-09-05'"

1 Like