Question

updated_at Not returning Correct Results

  • 6 December 2021
  • 2 replies
  • 43 views

Badge +4

Hi -

I’m doing a query to find all tickets that have NOT been updated for several days.

Per the V2 API documentation, I’m using the following query (replacing domain with ours, and encoding the URI - but I’m showing the unencoded version here for clarity):

https://<domain>.freshdesk.com/api/v2/search/tickets?query="(status:2 OR status:3 OR status:6 OR status:7 OR status:9 OR status:17 OR status:18 OR status:20 OR status:22 OR status:23) AND (updated_at:<'2021-12-01')"

The encoded version is:

https://<domain>.freshdesk.com/api/v2/search/tickets?query=%22%28status:2%20OR%20status:3%20OR%20status:6%20OR%20status:7%20OR%20status:9%20OR%20status:17%20OR%20status:18%20OR%20status:20%20OR%20status:22%20OR%20status:23%29%20AND%20(updated_at:<%272021-12-01%27)%22&page=

However, in the results I’m getting tickets that have been updated on 12/2, 12/3 and 12/4 so it does not seem to be honoring the updated_at and less than/before operator.

Help?

 


2 replies

Userlevel 5
Badge +12

Hello @labatt, I hope you are doing well. Ideally, this should not be the case as the query is in the right format. For the descrepency you are facing with the API results, can you try only with the updated_at filter and see if the results are right? Also, can you kindly DM us your account details so that we can have the logs checked and help you further here? 

Are there any fixes in place/coming soon for this as it still appears to be an issue for me, having to write callback functions to do date filtering myself which isn’t ideal as I then have to fight with the pagination to ensure I can get the top x for each date range I am using. I have a workaround as mentioned, but has overcomplicated the code needed.

Reply