Add a "group_by" clause while getting tickets | The place for Zendesk users to come together and share
Skip to main content
Question

Add a "group_by" clause while getting tickets

  • May 28, 2024
  • 0 replies
  • 0 views

Amaury11

We are using Zendesk as a ticketing tools to let our client declare their stolen devices.

Due to some constraints of our application, one device can have multiples tickets. In our front app, we want to display only the most recent ticket of a device. There is also “page” and “size” parameters set in the request.

 

So here is the issue, for example:

The front asks to display 10 tickets 

==> The back requests the /api/v2/search.json API with “sort_by: created_at”, “sort_order: desc” and “per_page: 10”.
====> Zendesk responds with 10 tickets, and the back analyses the response to check if there is multiples tickets for the same device (the device_id is declared in a custom_field, let's say it's "custom_field_12345")

======> We can end up with less than 10 tickets and it won't fit with the request of the front.

 

Is there a way to get the list of all most recents tickets only using the Zendesk API ? I tried something with a “group_by: custom_field_12345” in the header but 1. it doesn't work and 2. it's doesn't exist in the documentation.

 

Thank you for your help