Zendesk Support search reference

Have more questions? Submit a request

182 Comments

  • Kirthi Priya Debbadi
    Comment actions Permalink

    Hi Joseph,

     

    Thanks for the reply. I have been trying to use the following query in my curl command to get the list of open tickets, but it does not seem to work. This replies with a huge number of tickets which have the status as open, closed, solved, pending etc.

    /api/v2/search.json?query=status:open

    I do not want to make use of a view. Can you please help me in knowing where I am going wrong?

    0
  • Charles Wood
    Comment actions Permalink

    @Kirthi, can you post your entire curl command?

    You might also consider trying out Postman (https://www.getpostman.com/) for testing out queries. It's a really fantastic GUI that makes it a lot easier to explore REST APIs.

    0
  • Charles Wood
    Comment actions Permalink

    Hi Jessie,

    "ticket_sharing" is not listed as an option for "via" in this document. In addition, the string "ticket_sharing" doesn't occur on this page at all. Well, it does now, in this comment ;)

    Thanks!

    0
  • Kirthi Priya Debbadi
    Comment actions Permalink

    @Charles I would definitely prefer using postman. I am using my Zendesk API token to make calls. Can you please give me a sample of the URI along with the query and headers which needs to be passed for getting all the open tickets as a response?

    0
  • Derek Zhao
    Comment actions Permalink

    Hi,

    I just want to point out the example for the created search should say -8:00 for standard pacific time

    From the article: 

    created>2015-09-01T12:00:00+08:00

    "The first example above searches for anything created after September 1, 2015 at 12:00 p.m. (Pacific Standard Time)."

    It should be: 

    created>2015-09-01T12:00:00-08:00
    0
  • Jessie Schutz
    Comment actions Permalink

    Thanks for the heads-up, Derek! I'll pass this along to our Documentation team. :)

    0
  • Vladyslav
    Comment actions Permalink

    Hello, can I search by custom_role ?

    0
  • Jason Littrell
    Comment actions Permalink

    @Vladyslav The "role" keyword will accept the custom role name as a search value. If the role name has spaces in it, you'll need to wrap it in double quotes. For example, this would find all agents with a Team Leader role:

    role:"Team Leader"
    0
  • Vladyslav
    Comment actions Permalink

    Thank you.

    0
  • Zoe Rowley
    Comment actions Permalink

    Hi,
    is there a way to filter on tickets that only have over 2 comments?

    Cheers,

    Zoe

    0
  • Jupete Manitas
    Comment actions Permalink

    Hi Zoe,

    Thanks for writing! Unfortunately, that searching or filtering functionality is not supported yet for now. 

    Please let us know for additional questions or concerns.

    Thanks!

    0
  • Brian Correia
    Comment actions Permalink

    Hiya Zendesk,

    Is there a way to use "OR" logic in these queries? If I wanted to search, for example, for all tickets that had a certain string in the ticket's "description" OR in the ticket's "fieldvalue"?

    EDIT: probably just searching for such a string using double quotes "like so" would be simpler solution? Still curious about the above question, though.

    0
  • Leigh B
    Comment actions Permalink

    Are attachments searchable in the help center?

    0
  • Nicole - Community Manager
    Comment actions Permalink

    HI Leigh, 

    Unfortunately not. There is, however, an existing conversation on this in the Product Feedback topic. You're welcome to add your voice and use-case to that thread; this is one of the data points that Product Managers use to prioritize their projects. There's also a workaround mentioned by one user within the thread. 

    0
  • Andrew Dietrich
    Comment actions Permalink

    Hi Brian,

    The OR operator will work if you run one search with two different values for the same field, e.g.:

    description:"pink elephant" description:"red otter"


    Otherwise, as you already mentioned, there is an implicit OR in a single search string, as it searches across all field types.

    0
  • Jonathan March
    Comment actions Permalink

    This article is missing the useful `requester_updated` keyword

    EDIT: AFAICT the keyword works (just tried it on a hunch, because after all it *is* available as a view column), but is not documented.

    0
  • Tyson Jacques
    Comment actions Permalink

    Is it possible to change the default sort behavior so it always sorts by last update upon searching? 

    0
  • Alex M
    Comment actions Permalink

    This has already been flagged by a couple of other people over the last year (here and here), but the searching by combined date and time section is either incorrect, or doesn't work as I'd expect.

    From the article:

     

    You can specify a combined date and time using ISO8601 syntax:
    created>2015-09-01T12:00:00+08:00
    updated<2015-09-01T12:00:00Z

    The first example above searches for anything created after September 1, 2015 at 12:00 p.m. (Pacific Standard Time).

     

    I would expect PST to be -08:00, not +08:00. Can you confirm whether this is an error in the article, or if it's just searching doesn't work as I'm assuming it should?

    0
  • Josh Crook
    Comment actions Permalink

    @Alex M

    It's a typo in the documentation. It works as you would expect it to.

    1
  • Eric Norris
    Comment actions Permalink

    After '+add contact' a Twitter handle for a user, is there a way to search for that Twitter handle using the Search?

    0
  • Dominic Feira
    Comment actions Permalink

    How do I perform a query on users and sort them by name?

    When I search users the resulting order isn't stable. Each time I do the query the order changes. I'd like a stable order.

    0
  • Hilary Hungerford
    Comment actions Permalink

    @Eric:

    Unfortunately, it currently is not possible to search for users based on their Twitter or Facebook handles. I'd recommend sharing your feedback in our Product Feedback forum to bring more visibility to this request. You can, however, search for tickets created via those channels by searching for via:twitter or via:facebook, which may help make those users easier to find. 

    @Dominic:

    While it is not possible to search for users and sort them by name or email, you can narrow down your query using the "created" or updated" parameters (e.g. "created>yyyy-mm-dd"). I would also recommend creating a post in our Product Feedback forum to share your suggestion.

    0
  • Madhav Attili
    Comment actions Permalink

    Hi All,

     

    I have recently started developing and using apps in Zendesk

    So in my app i'm trying to get the require info using rest API SEARCH and when I log the data that I retrieve i'm seeing nothing in the console log o/p. could you please help on this ? refer below for screenshot

    On the left you can see the app that I coded from the dev docs given and on the right you see the log o/p which is empty

    Also below is the JS I'm using

     

    var conf = {
          url: '/api/v2/search.json?query=type%3Aticket+status%3Aopen'+'.json',
          type:'GET',
          datatype: 'json'
        };

        client.request(conf).then(

          function(data) {
            console.log(data);
            //dataDisplay(data);

          },
          function(err) {
            console.error(err);
            //errorDisplay(err);
          });

     

     

     

     

    0
  • Bryan Flynn
    Comment actions Permalink

    Hi @Madhav. You're close. It's the +'json' that's causing issues here. It's unnecessary and is in fact becoming part of your search string, which is causing no tickets to be returned.

    Here's a simplified code snippet that should work better (you also don't need to worry about encoding the search string if calling the API this way):

          var conf = {
            url: '/api/v2/search.json?query=type:ticket status:open',
            type: 'GET',
            dataType: 'json'
          };

          client.request(conf).then(
            function(data) {
              console.log(data);
              //dataDisplay(data);
            },
            function(err) {
              console.error(err);
              //errorDisplay(err);
            });

    Hope this gets you going!

    0
  • Xiaolei Jin
    Comment actions Permalink

    Can we filter by new sharing_agreement_ids field?

    0
  • Nick Dushack
    Comment actions Permalink

    Hi Xiaolei,

    Unfortunately, there is not a native way to search for sharing agreement IDs. However, there are a few methods by which you can determine these tickets:

    1. Create a View that filters by ticket sharing agreement: there are two conditions in particular for this. One is Ticket Sharing: Sent to and the other is Ticket Sharing: Received from. You can then choose which agreement you want filtered into the View

    2. Use Triggers to tag these tickets as they arrive: you can utilize those same conditions to add tags to these tickets as they arrive, then use those tags in your search field

    3. Utilize the API to list ticket sharing agreements: this will list all sharing agreements, but not their associated tickets, and you cannot filter by any criteria other than the sharing agreement ID itself

    I hope this gets you in the right direction!

    0
  • Wisam.
    Comment actions Permalink

    Hi... is there is a way to sort the tickets by the subject ?

    1
  • Jessie Schutz
    Comment actions Permalink

    Hi Wisam!

    You can sort by subject in a View, but not in search results. Is there something in particular you need to do that for?

    0
  • Wisam.
    Comment actions Permalink

    Hello Jessie 

     

    Yes, It is for searching for the unsolved duplicates tickets for the solved tickets under the same order number.

    0
  • Jessie Schutz
    Comment actions Permalink

    Hi Wisam!

    I think the best way to do this would be to create a View that filters for these tickets, rather than doing a search. Then you can sort by subject and merge or whatever other process you have in place.

    0

Please sign in to leave a comment.

Powered by Zendesk