Zendesk: Query Builder
In this article, we will show you how to create a custom query using the Zendesk Query Builder.
For this example, our goal is to create a new metric that will reflect the number of "old" tickets from email. Therefore, we're looking for a count of all tickets where priority is greater than "low", status is not equal to "new" and source is "email."
IN THIS ARTICLE
1. Basic Options
We chose to name our sample query "Old Tickets from Email".
User). The query will only return results for the type you choose.
For this example, we chose Type: Tickets.
Read more about date ranges: Adding and Modifying Additional Date Range.
In our example, we selected "Updated" so we can see when the last action was taken.
Same interval last year.
ANDboolean logic. Filtered queries restrict the rows that do (or do not) get included in the result.
Each row in the result is tested against the filter. If the filter matches, the row is retained. If it doesn't match, the row is dropped.
For our example, here's how each metric filter row would be tested:
- Equals: Return results for tickets where priority is exactly
- Does not equal: Return results for tickets where priority is not
- Greater than: Return results for tickets where priority is strictly greater than
- Less than: Return results for tickets where priority is strictly less than
- Greater than or equal to: Return results for tickets where priority is
- Less than or equal to: Return results for tickets where priority is
2. Advanced Options
In the "Advanced Options" section you have the ability to specify an exact search phrase. Our case would return tickets with "Date issue" string inside their tag, name, description, etc.
3. Search Query
If you prefer to use Zendesk Search, you have the ability to pull data using a Search Query. This is selected in the radio buttons under your custom query name. Databox's Search Query follows the same rules as Zendesk Search. If you're interested in learning how to use Zendesk Search, here is a tutorial.
When everything is set, click "Run query" to show your Data preview.
4. Data Preview
In Data Preview you will see total values for your new metric.
You can only get total values for today, yesterday, etc. If you want to see a change for your metric on a databoard (for example on line chart visualization) you have to collect data for several days/ weeks.
When your query is ready, click "Save query." This creates a metric in Databox, with the metric name the same as the custom query name you set.
In our example, this is number of "Old Tickets from Email".
Click "..." next to "Value" and select "Round values." Enter the number of decimal places to be rounded to in the corresponding textbox, and values will be rounded accordingly.