how to get the list of tickets belong to organisation id with custom_fields filter | Community
Skip to main content

how to get the list of tickets belong to organisation id with custom_fields filter

  • March 4, 2024
  • 1 reply
  • 0 views

Hi,

Is there any query API to list all tickets of an organization with a custom_fields filter?

Currently, I can get the tickets belonging to the organization using the below endpoint
{{baseUrl}}/api/v2/organizations/{organization_id}/tickets?sort=updated_at
 
from the above API result, I want to filter only tickets that contain 
custom_fields: [
id: xxx
value: yyy
]
 
can you pls guide me on using a single API request to get the data I am looking for? 
 
Thanks,
 

1 reply

  • March 4, 2024

Hello @abdul14

Zendesk's Search API allows you to query for tickets with specific custom field values. Here's an example of how you might structure your API call to search for tickets with a particular custom field value:

GET {{baseUrl}}/api/v2/search.json?query=type:ticket organization:{organization_id} fieldvalue:{field_value}

For reference on searching custom ticket fields you can use the following article