Full text searches return results from all the data in Zendesk Support. To search exclusively for ticket data, you can use ticket property keywords.
status:open
In the example above, status is the keyword and open is the value. This search returns all the tickets with status set to open. This of course directly maps to the ticket fields and their values.
status:open group:"Level 2"
This returns all the open tickets that are assigned to the Level 2 support group.
This article covers the following topics:
For a quick reference to all searchable data, see Zendesk Support search reference.
Ticket property keywords
The ticket property keywords and their values that you can use in your searches are described in the following table. Not all of the ticket data is searchable. Administrators and agents can search for tickets using these keywords.
Keyword | Description |
---|---|
Ticket ID |
There isn't a property keyword for the ticket ID. Instead, you simply search for the ticket by its ID number in the following format:
233 |
created | The date, or date and time, the ticket was created. Enter date in yyy-mm-dd format.
created:2011-05-01 Search within a date or time range. Enter times using ISO 8601 syntax. For example, to search for a ticket created between 10:30 a.m. and 12 p.m. (UTC) on August 1, 2014:
created>2014-08-01T10:30:00Z created<2014-08-01T12:00:00Z For more information on using date and time in your search, see Searching by date and time. |
updated | The date of the most recent ticket update.
updated>2011-05-15 For more information on using date and time in your search, see Searching by date and time. |
solved | The date the ticket was set to solved.
solved<2011-06-01 For more information on using date and time in your search, see Searching by date and time. |
due_date | The due date of tickets.
due_date:2011-06-01 For more information on using date and time in your search, see Searching by date and time. |
assignee | The assigned agent or other entity. You can specify "none", "me", user name (full name or partial), email address, user ID, or phone number.
assignee:"Susan Warren" |
submitter | The ticket submitter. This may be different than the requester if the ticket was submitted by an agent on behalf of the requester. You can specify "none", "me", user name (full name or partial), email address, user ID, or phone number. See Searching ticket user roles.
submitter:me |
requester | The ticket requester. You can specify "none", "me", user name (full name or partial), email address, user ID, or phone number.
requester:amy@mondocam.com |
subject | The text in the ticket's subject.
subject:"upgrade account" |
description | The text in the ticket's description and comments.
description:defective |
status | Possible values: new, open, pending, hold, solved, closed.
status<closed |
ticket_type | Possible values: question, incident, problem, task.
ticket_type:problem |
priority | Possible values: low, normal, high, urgent.
priority>low |
group | The assigned agent's group name.
group:"Level 2" |
organization | The name or ID of the ticket requester's organization.
organization:customers |
tags | Tags that have been added to the ticket.
tags:premium To find tickets that include either of two tags, use : tags:important tags:urgent To find tickets that include both tags: tags:"important urgent" |
via | The ticket's source, which can be any of the following:
via:phone |
commenter | People who have added comments to tickets. You can specify "none", "me", user name (full name or partial), email address, user ID, or phone number.
commenter:"Mike" |
cc | People who have been CC'd on tickets. You can specify "none", "me", user name (full name or partial), email address, user ID, or phone number.
cc:amanda@mondocam.com |
fieldvalue |
Search for a specific value in custom ticket fields by using the fieldvalue keyword. For example: fieldvalue:12345 This returns all the tickets that have a custom field with the value "12345." For drop-down custom fields, search based on the option's title. If you're using nested drop-down fields, search using the option's tag. For details, see Organizing drop-down list options. |
brand | Search for a specific Brand on a ticket. A Brand with two or more words requires quotation marks, while a one word brand can be searched as is. For example:
brand:Nordstrom Or
brand: "Banana Republic" |
All of the ticket property keywords can be used in search statements alone, in combination with other ticket property keywords, or with the type keyword (see Using the type keyword).
Searching ticket user roles
Users have various roles on tickets (requester, assignee, etc). These user roles can be searched by the user's ID, their name (partial or full), or their email address, as in these examples:
requester:52789480 submitter:amy assignee:"amy moore" requester:amy@mondocam.com
Notice that none of these searches required the ID, or name, or email to be explicitly declared. Each of these keywords accepts all of these user identifiers.
Searching custom ticket fields
You can search for a specific value in custom ticket fields by using the fieldvalue keyword. For example:
fieldvalue:12345
This returns all the tickets that have a custom field with the value "12345."
If your custom field assigns a tag to the ticket, you can also search for custom ticket fields using the tags that you assigned to the custom field. For example, if you created a drop-down list, you can search for the tags assigned to each list box item.
To search for specific drop-down list selections, you use the tags keyword.
tags:product_question
This applies to the custom field formats that be assigned tags: the drop-down list and the checkbox. The checkbox custom field can include a tag to indicate that the user has clicked the checkbox.
All of the other custom fields (text, multi-line text, numeric, decimal, regular expression) can be searched by the text or number values submitted by ticket requesters. For example, if you added a numeric custom field to the support request form to collect demographic information such as age, you can search for the numbers that the requesters entered in the form (type:ticket "18").
Searching for ticket attachments
You can use the following keywords when searching for ticket attachments.
Keyword | Description |
---|---|
has_attachment | You use this keyword to search for tickets that either do or not contain file attachments. There are two valid values for this keyword: true and false.
has_attachment:true has_attachment:false |
attachment_name | You can also search for a file attachment by name.
attachment_name:image001.jpg |
Searching for tickets with a specific ticket form
You can search for a ticket form and get results for all tickets where that ticket form is applied. For example, the following search returns all tickets that use the Change Request ticket form:
form:"Change Request"
Searching for tickets by telephone number
To locate a user's tickets based on their phone number, you can use a search statement like this:
requester:+14154187506 status:new
This works with all of the ticket user roles: submitter, requester, and assignee.
Searching for yourself
The me keyword value allows you to search user properties in tickets where the value is your own user account (as the currently logged in user).
assignee:me
- requester:me
- submitter:me
- assignee:me
For information about searching for user profile data, see Searching users.
Ordering and sorting ticket search results
Search results can be ordered and sorted using the order_by and sort keywords.
status:new order_by:updated_at sort:asc
Here are the valid sorting and ordering keyword and value pairs that you can use:
- sort:asc
- sort:desc
- order_by:priority
- order_by:status
- order_by:ticket_type
- order_by:updated_at
- order_by:created_at
All of the order_by and sort keyword/values pairs can be used when searching ticket data.
55 Comments
Hey Jason!
When you use a dropdown field, the option selected adds a tag to the ticket. So you can just search for the tag associated with that "Bug" selection.
Would be nice if there were GUI tools in the UI to build complex search queries...
What's the recommended method of searching for tickets solved by an agent, within a given time-frame?
Hey John -
Welcome to the Zendesk Community!
To clarify, are you looking to report on individual agents, or all tickets that were solved by any agent?
Also, are you looking to see which agent was assigned to the ticket and when it was solved, or which agent solved it out? (A ticket can be assigned to one agent but solved by another).
Hi Nicole,
Cheers - I'm after individual agents. I'd like counts for tickets solved by each agent, for bar/pie charts. Assignment doesn't matter, just solved-by.
Hey John -
Apologies for the delayed response. What you'll need to do here is build a report; there's no search capability that will show this, exactly.
Do you know what plan level you're on? It may impact what data you have access to...
So i can search tickets by a custom field but not an external_id, how annoying. external_id works nice for users but not tickets. To me its a strange decision from the API team. But Im sure there is a reason for it.
Hi, what's the best way to find all tickets that used a particular macro?
Alex -
You may find this article helpful: Reporting on macros using tags in Insights
Hi,
Would anyone have any examples of recipes for a report that would check missing phone numbers on our tickets?
This would be from the initial set up of tickets and I need to identify the Assignee responsible too please.
Any other recipes for reports that I can use to assess an incomplete ticket at a linked or child ticket level too please?
Thanks
Sam
Hi Sam! Welcome to the Community!
What are you planning to do with this information? Do you need to have this information in a dashboard, or do you want to do more of an audit to ensure that tickets are being handled correctly?
Hi Zendesk - I have a request for the advanced ticket search field. I would like to be able to use Boolean operators, at least to a limited extent. For example, if I'm researching reports of crashes in our Android app, I'd like to search for tickets tagged "crash" but NOT those which are also tagged "iOS". In order to see these kinds of details, I would need to open each individual ticket, since the preview shown on mouse-over doesn't always clue me in. And trying to do the same search through the Tags screen is even more time-consuming.
Many thanks!
Thanks for sharing your feedback, Crystal!
Hi!
Is there any way I could sort the results by a value in a specific custom field? I have a field in a form that provides a specific date and I would like to sort my results by the value of that date.
Thanks!
Hi Raul,
If you'd like to search for tickets by the custom date field you've set up you should be able to use "fieldvalue:2019-01-16" and replace 2019-01-16 with the date you'd like to search for.
Could you test this to see if that gets you the results you're looking for?
Hey Brett,
I appreciate your response. I am aware of this query, however, as I mentioned, I’m attempting to sort by the value of a custom field, not search by it. In the search API articles, I couldn’t find if this was possible.
Thank you
Thanks for the clarification Raul!
Sorting is actually only available for the following fields:
You can find some additional information in our Zendesk Support Search Reference article which I've linked for you.
I hope this clears up any confusion but let us know if you have any other questions.
Hello,
How do I search for Ticket IDs that are bigger than a specific ID?
For example, I want all tickets > ID.
I've tried /api/v2/search.json?query=id>1892069 type:ticket but it only returns that ID.
Thanks,
Nicolas
Hi Nicolas -
There's not a way to search by ticket ID "greater than" as you're asking. However, if what you're trying to do is look for all tickets created after a specific one, you could determine the date that specific one was created and then run a search for tickets newer than that one and it would effectively return the same results as ticket IDs greater than that one. Let me know if that solves the issue for you or if you have additional questions!
Thanks Nicole.
I do have another question. If I would like to get the number of public and private comments per user, what is the best way to do it via the API?
In the tickets, I only see the if there are public or private comments and the number of comment counts (with side loading) but it's not possible to know how many are public and how many are private.
I could use GET /api/v2/tickets/{ticket_id}/comments.json but I have to get this for each of the different tickets which will probably take a long time.
Is there a better way of doing this?
Hi Nicolas,
What's the current API call you're using to pull this information? You can use the comment_events sideload which will return a comment_public object property. More information can be found in our API Documentation which I've linked for you.
Let me know if I'm misunderstanding your question.
Thanks!
Can someone please tell me how to run a report that shows me ALL tickets? We use this regularly to determine training needs, as well as when we have clients who ask for discounted rates due to "all the problerms we've had". I need to provide our management team iwth all the tickets the client has submitted since inception. I'm not versed in computer code or programming in any way, so I just need simple steps, like: go to admin > views > etc.
It has to include archived tickets since this is an auto function and not something I would ever do. I need access to them. Easy access. Don't think I'm the only one.
Hey Syndi,
Depending on the plan level you're on, you should be able to export your ticket data using the steps mentioned in the following article: Exporting data to a JSON, CSV, or XML file (Professional and Enterprise)
If you're on the Professional plan, you should see the export option by navigating to Admin>Manage>Reports>Export.
You can also view additional ticket export options here: Ticket export options
If you're on the Professional or Enterprise plan but don't see this option let me know :)
Is this possible to search tickets that not belong to two different groups
I tried like -group:"Group A -group:Group B" and seems not working correctly
Hello Liqiong Bu,
This question was responded to on a different post.
Response
Best regards.
Please sign in to leave a comment.