Searching tickets Follow

Comments

36 comments

  • Avatar
    Zach Hanes

    Hi Zendesk,

    How would I search for tickets where the ticket body contains multiple separate strings? For example, I'm looking for all tickets containing both "Facebook" and "pending." Is there anything equivalent to an AND operator?

    Also, how can I distinguish between public replies and internal notes when searching? From what I can tell, both are searched when you use "description." Am I missing something?

  • Avatar
    James Peterson

    Hi Zach,

    This behavior will be a bit different depending on where you search, in the Agent interface or the Help Center. Searching in the agent interface should require 100% match for all terms of the search, so just putting "Facebook" and "pending" will be equivalent to and.

    For Help Center, you'd need to put the entire phrase in quotes in order to ensure they are searched, or else only some of the words will be required. If each individual word is in quotes, then results will still be returned that do not contain all of the words.

    Sincerely,
    James Peterson

  • Avatar
    Carlos (Edited )

    How would I specify a word and a date created?

    For example: I want all tickets with the name Athena in the description created after 9/2/2015?

    I tried this but had no joy: /api/v2/search.json?query=description:athena&created>2015-09-02

    It just returned all tickets before and after with the word Athena

  • Avatar
    James Peterson

    Hi Carlos,

    Have you tried /api/v2/search.json?query=athena&created>2015-09-02&type:ticket ?

  • Avatar
    Michael

    I'd like to do a search for tickets that don't have either of two tags (Ex. Tag: "ABC" and Tag: "123"). Is there a way to isolate tickets that have neither of these tags?

  • Avatar
    Carlos

    Hey James,

    Didn't work :(

  • Avatar
    James Peterson

    Hi Michael,

    I'm not familiar with any way to search 'not'; it is possible to make reports with Insights for tickets that do not contain certain tags. Perhaps that would work for you?

  • Avatar
    Michael

    Hi James,

    I'm a starter user so I don't believe that option is available to me.

    Can anyone else confirm that this features doesn't exist, or is there a request somewhere that I can give a bump to?

  • Avatar
    Andrew Meyercord

    I can confirm, based on responses from other Zendesk representatives, that there is no way to perform a "negative" search, or a search for items where a term does not appear. There is also no support for an "or" search, or items where any of multiple terms appear. This is pretty lazy search implementation in my opinion.

  • Avatar
    Michael

    Hi Andrew,

    Thanks for confirming. Agreed, the current implementation appears to be very basic.

  • Avatar
    Andrew Meyercord (Edited )

    To clarify my previous statement, you can search for items that don't include a specific word or value by putting a minus symbol in front of the word in your search, but this will exclude tickets where these words appear anywhere. You can't restrict the exclusion to specific keywords or tags. So you could search for "-ABC -123" and presumably, you'd get all tickets which didn't contain either of those strings in any field, but if those are common words in the description of your tickets you would probably exclude a bunch of tickets that you don't intend to.

    Also, Zendesk does do an OR search when you specify two values with the same property keyword, but you can't do an OR search between two different keywords.

  • Avatar
    Chris Mccraw

    I've got an interesting situation - I would like to search for tickets from submitters that come from a domain (eg: type:ticket submitter:*@example.com). I can't find any way to get even close to this - that kind of search (with or without the asterisk and also the at symbol) turns up nothing, and searching on plain "type:ticket example.com" i get a bazillion hits - because the dot is a word separator so I get all tickets with example as well as all tickets with the substring 'com' in them (lame that it finds 'community' when i search for com!)

    Anyone have any bright ideas around doing this? I resorted to the csv export of the ticket feed to find them, but that is a pretty gnarly workaround.

  • Avatar
    Jessie Schutz

    Hi Chris!

    The first thing that springs to mind is Organizations. You can set up your Orgs so that people from a specific domain are automatically added to a speciflc Org. Once that's set up, you'd be able to do a search just for that Organization and it'd pull up the tickets you're looking for.

    Do you think that would work for you?

  • Avatar
    Chris Mccraw

    Thanks, Jessie. Unfortunately many customers share the same domain, so we cannot auto-group them that way - hence my need to search for tickets as I mentioned. I spoke with Keith on your team and he suggested that it might be possible to do some work with tagging as tickets came in that fell into a "default org" for that domain so I'd be able to find them later and that may work for the future, but I really want to search for historical tickets rather than group new ones - this is usually in reaction to someone getting (manually) assigned to the wrong org from a domain and figuring out what collateral damage that may have happened before we figured that out.

    So, I guess, just add me to the list of people who wish your search worked a lot more thoroughly, or that we could create much more flexible views - eg "requester email matches *@example.com".

  • Avatar
    Andrew Dietrich

    Hi Chris,

    If you do go the organization route, you can take advantage of the multi-org function (already enabled on your Zendesk) so that they can belong to that default domain-mapped org (in addition to whichever org(s) they are actually affiliated with). This allows you to do a full historical search by using the Organization filter along with whatever other criteria you want.

    It's still kind of a wonky workaround, though, so I certainly understand where you're coming from. I'd suggest contributing to the Product Feedback Community section about this:

    https://support.zendesk.com/hc/en-us/community/topics/200132066-Product-feedback

  • Avatar
    Arlene Salgado (Edited )

    Hi guys,
    I have a question for you and I hope you can help me with this.
    How can I get tickets searching with a date range... I'm using the API. I did something like this: https://subdomain.zendesk.com/api/v2/search.json?query=created:2015-12-17&type:ticket but didn't works.... Anyone that can help me please?

  • Avatar
    James Peterson

    Hi Arlene,
    If you are trying to fine all tickets created between 2015-12-17 and today, you should use created>2015-12-17 instead of created:2015-12-17. If that doesn't help, could you explain the results you are receiving and why they are not correct, ie not working?

  • Avatar
    Arlene Salgado

    Hi James,
    Thanks for you help, it works. Now I have another question, How can I get a date range, for example, tickets between 2015-12-17 and 2015-12-20?

  • Avatar
    James Peterson

    Hi Arlene,

    In that case you just need to use two date filters, like this: created>2015-12-01 created<2015-12-21.

  • Avatar
    Arlene Salgado

    Thanks James.

  • Avatar
    Daniel Sagaya Raj (Edited )

    Hi, 

     

    The search API only returns 100 items when request even if i set per_page parameter to 500. It would be great if some one can share your experience on how to get all the results in one single request. 

     

     

  • Avatar
    Prateek Chhetri

    Hi Daniel,

    By default the max number of items that any endpoint will return is 100 items. You will have to paginate through the results in order to see the other results.

    You can find more info about this here: https://developer.zendesk.com/rest_api/docs/core/introduction#pagination

  • Avatar
    Liang Dai

    Hi All,

    We are interested in learning how you, Zendesk customers, use the Zendesk search in your work to help us continue enhancing and improving this feature.

    If you and your team are interested in sharing how search supports your work and are available for talking to us, please sign up using the form here. http://goo.gl/forms/IDuqGK20uu397YAb2

    We will follow up from there if we find a match to our study. Due to limited resource available, we may not be able to cover all customers. 

    Thanks!

  • Avatar
    Sandro Alvares (Edited )

    Hi,

    1) Why not available organization:me and cc:me? (Searching for yourself)

    2) How to make value null -> fieldvalue:none?

  • Avatar
    kampstand

    I would like to get a list of Issue number, open, pending and closed, title of issue, on an specific country excluding all spam issues. Anyone could help me with that string?

  • Avatar
    Bob Novak

    Hi Sandro - the "me" search should work for all the user role properties in tickets. I tried "cc:me" and it returned a list of tickets. If that's not working for you please submit a ticket.

    I don't expect organization to work because you don't want to search for yourself as the organization, but your org's name. If you have a use-case for different behavior though, that's good feedback to share in the Feedback Forum.

    For searching null values, it would be good to know about your use case. For discussing that I would invite you into a ticket. You should get an email notification shortly.

  • Avatar
    Bob Novak (Edited )
  • Avatar
    Sandro Alvares (Edited )

    Hello Bob,

    1) About cc:me is why only work /api/v2/requests/ccd.json ? not exist search need use 2 ajax : /api/v2/search.json?query=type:ticket%20cc:'+userjson.id+'...  (look item2 example)

    2) Not exist organization:me is do need 2 ajax too and use /api/v2/users/me.json is get organization_id 

    $.ajax({url: '/api/v2/users/me.json', type: 'get'}).success(function(userjson) {
    $.ajax({url: '/api/v2/search.json?query=type:ticket%20organization:'+userjson.user.organization_id+'%20status<solved&sort_by=updated_at&sort_order=desc'}).success(function(json) {
    $.each(json.results, function(index) {
    console.log('Ticket: '+json.results[index].id+' - Status: '+json.results[index].status);
    });
    }).fail(function(e) { alert('Error:\n\n'+e);} );
    }).fail(function(e) { alert('Error:\n\n'+e);} );

    Too delay slow.

  • Avatar
    Bob Novak

    Hi Sandro - we're going to need to dig deeper into that, so let's discuss it in the ticket we have. Thanks!

  • Avatar
    Jason

    Let's say I have a custom field ID of:

    fieldvalue:12345

    If that field value is assigned a value using a drop list of say 3 different values like "Software", "License", and "Bug", how would I do a search where that custom field = "Bug"? 

    In other words, I want to query for tickets that have a custom field value of "Bug" and the custom field ID is 12345. Is it something like:

    fieldvalue:12345="Bug" or something? I've tried various forms with no luck!

Please sign in to leave a comment.

Powered by Zendesk