How to search tickets by using custom field?

Answered

12 Comments

  • Rebecca
    Comment actions Permalink

    Hello Dmitriy- 

    Unfortunately, there is not a means using the API to search custom fields via the search endpoint. You can set up your query to search a field value, for example, and return all incidents of this value but unforunately you cannot tell it to only search a specific custom field. 

    Further, this would be the same using the search in the Agent Interface where you would use fieldvalue:_____ to search for custom field data. 

    However, another possibility to get more specific custom ticket field data via search would be searching by tags using: query=type:user tags:ticket_tag as many custom fields(drop down, check box, etc) do add tags to tickets. 

    1
  • Hege Moen
    Comment actions Permalink

    We're also in the need to search for tickets with a certain custom field.

    I find it strange that the searches are so limited, all the fields available to fill out should be searchable.

    1
  • Jessie Schutz
    Comment actions Permalink

    Hi Hege!

    What kind of custom field are you trying to search? If you're using a dropdown or checkbox field a ticket tag is generated when a selection is made, so you can search for the desired tag.

    0
  • shane
    Comment actions Permalink

    I also have the need for this.  I don't want to have to store a list of ticket ids in my system just to query for a set of tickets when I have a custom ticket number field that contains what I need to filter by anyway.
    It also wouldn't make sense for me to set a tag for this data as it would add 'junk' to the ticket tags which are used by our agents.

    0
  • Sergio Anarte
    Comment actions Permalink

    If I have two date custom fields and I search (using search.json end point) for a date, I would' like to search for a specific custom field, not search for all date custom fields in the instance, any alternative?

    Thanks in advance.

    0
  • Madison Davis
    Comment actions Permalink

    Hey Sergio! Could you describe what you'd do with that information once you have it? Or what you're hoping to achieve by querying that way? As Rebecca mentioned, there aren't any alternatives via API, but if you're willing to share your use case a bit, we might be able to think of a workaround. 

    0
  • Sergio Anarte
    Comment actions Permalink

    Sure Madison, no probs. Use case is as follows:

    2 custom date fields ("Next Renewal Date" and "Next Meeting Date"), I would like to search by using just one of the filters in the api query. How can I do that? afaik, if I do that using the standard search endpoint and "2019/4/20", the response will contain all tickets with 2019/4/20 as a value in "Next Renewal Date" OR "Next Meeting Date". Am I right?

    Thank you!

    0
  • Madison Davis
    Comment actions Permalink

    Thanks, Sergio! Unfortunately I've done a little digging and it doesn't sound like there is currently a way to differentiate these the way you want to. I totally can understand the usefulness of this functionality, though. I took a look around the Product Feedback posts and did find this feature request: https://support.zendesk.com/hc/en-us/community/posts/207670077-Searching-Custom-Ticket-Fields 

    It looks like there's a workaround listed in the replies, but I would note that it is unsupported and not guaranteed to work for everyone. While you're there, I'd recommend chiming in on the post with your use case! 

    0
  • Matthew Bridges
    Comment actions Permalink

    Hi @Madison,

     

    I'm looking into a similar problem, as to how I could search tickets by custom field value using the Zendesk Support Search API. After signing in, I'm not authorised to view the link you shared above.

    Any suggestions?

     

    Thanks,

    Matt

    0
  • Madison Davis
    Comment actions Permalink

    Hey Matt! I'm so sorry, it looks like what I actually found was an archived post. I would actually encourage you and Sergio to post your feedback with other API feature requests here: https://develop.zendesk.com/hc/en-us/community/topics/360000000788-Developer-Platform-Feature-Requests I looked around and didn't see any existing feature requests there either, so you will likely want to create a new post. 

    0
  • Anthony Magana
    Comment actions Permalink

    it's a bit easier to filter tickets by custom fields in zendesk explore to pull a list of ticket ID's associated with that custom field. You can then feed those ticket id's into one of the api's (like the tickets API) It's an extra pre-processing step which is annoying but the export as csv option in explore makes it a little easy. 

    1
  • Madison Davis
    Comment actions Permalink

    Thanks for sharing that workaround, Anthony! Glad to hear it worked for you.

    0

Please sign in to leave a comment.

Powered by Zendesk