Search Api for fetching tickets return wrong response after ticket created/removed for few minutes

7 Comments

  • Joey

    Hi there Oleh-

    As it states on the search API documentation, it can take up to a few minutes for results to be indexed. For a faster return of results consider our incremental ticket export.

    -1
  • Oleh Andrushko

    Hi Joseph,

    Thanks for Your reply,

    Yes, I understand that results cannot be immediately up to date due to indexing (that's fine with me). 

    The issue is:
    Why after some time when the returned result was already correct (so I assume indexing was done), next and probably some of the further requests could return wrong data again?

    2
  • Oleh Andrushko

    Hi there,

    Are there any updates on this issue? I suppose it could be related to some kind of load balancers. 

    My app displays the overall count of tickets with status open,
    Also it displays table of 10 latest tickets with paginating, filtering by tickets type, searching capabilities. 

    • For getting the count of opened tickets I am doing such request:
      /api/v2/search.json?type:Ticket%20requester:xxxxx%20status:open&per_page=1&page=1

    • For fetching tickets:
      /api/v2/search.json?query=type:Ticket%20requester:xxxxx&per_page=10&page=1&sort_by=created_at&sort_order=desc

      when filter/search/paging applied query string & params are built accordingly 



    When the new ticket is created  /api/v2/search.json  return different results for same request for nearly 3 mins.
    Sometimes including new ticket, sometimes not.
    That's why I end up with not valid count(new ticket is not counted), but this new ticket is present in table or vice versa.



    2
  • Garrick Rohm

    Hi Oleh,

    You're correct, the search result is returned from any of a number of applications server caches which are updated with new information in a rolling fashion, stabilizing once all caches have received the new information. (This is the indexing window to which Joey referred)

    If you need instantaneous and consistent visibility on brand new tickets, I'd recommend using the incremental tickets export endpoint: https://developer.zendesk.com/rest_api/docs/support/incremental_export#incremental-ticket-export

    Garrick Rohm
    Technical Support Architect | Zendesk
    Madison, WI

    0
  • Oleh Andrushko

    Thanks,

    I've read documentation about Incremental tickets export api endpoint. Unfortunately it does not meet my app requirements and as the result is not applicable, so could not be used in my case. Also I see there is a limit for incremental export api requests per minute.

    1
  • Garrick Rohm

    Yep, the rate limit is 10 requests per minute, so you could poll the incremental tickets API every 6 seconds (assuming less than 100 tickets are created between requests, due to pagination at 100 results). Could you explain more about the app requirements the response of this endpoint doesn't meet?

    Garrick Rohm
    Technical Support Architect | Zendesk
    Madison, WI

    0
  • Oleh Andrushko

    Hi Garrick, thanks for Your reply

    I need to display up-to-date tickets(with paging (10 items per page), sorting, filtering by status functionality), counts of opened tickets; all that for some requester id or cc'd in.

    Maybe I am missing something, but as I see for my needs using incremental export means to fetch all the tickets and do filtering, sorting, paging stuff on my side for each paging/sorting/filtering request. If there are thousands of tickets it looks like not a good approach.

    1

Please sign in to leave a comment.

Powered by Zendesk