Zendesk is removing Insights reporting on February 5th, 2021. If you are using Insights, you need to move to Explore, the latest generation of reporting for Zendesk products, before that time. If you need more time to move to Explore, you can apply for an extension using this form before January 22, 2021.
Tip: This recipe enables you to find durations within a single ticket field, like how long a ticket was in a group before escalating. For durations between different types of ticket events, like a group change and a comment, check out this recipe instead: Insights recipe: Duration between two or more ticket events in minutes.
Measuring the duration of a specific field value can give you lots of insight into how your Zendesk is performing. You can answer questions like: How long are agents holding on to tickets? How long do tickets take to cycle through each of your Support Levels? How do I measure the things that are important to me? This documentation will walk you through building some custom duration metrics to help answer these important questions. There are three duration facts in Insights that you can use. These three facts are related to the different types of updates that can occur on a ticket.
- [Text Field] Duration in minutes: Used to measure how long a text field (like Ticket Group, Status, or Priority) was set to a certain value
Note: This fact only measures the duration for past values. For example, if your ticket status is currently Open, you will not be able to see how long the ticket has been in the Open status.
- [Numeric Field] Fact duration in minutes: Used to measure how long a numeric field was set
- Satisfaction duration: Used to measure the length of time a ticket had a particular satisfaction rating
Note that duration can only measure calendar minutes, not business minutes.
You can read more about what types of Zendesk fields become attributes and which become facts in Understanding how custom fields are imported into Insights .How long are tickets sitting with my support groups?
The first step to answering this question is to build a custom metric.
Note: If you've never built a custom metric before, you might want to read Creating custom metrics in Insights. During metric creation, you'll be selecting elements available to you from within your Insights project. For a list of the default facts and attributes please see our objects reference guide .
You'll want to build the following metric and name it Avg Time Assigned to Group :

Dividing by 60 converts minutes to hours, which is a more useful unit of measurement in this case. Once you are back in the report editor you will select the following elements to create the report and then select the stacked bar graph as your format:
- WHAT: Avg Time Assigned to Group
- HOW: [Text Field] Previous Value, Month/Year (Event)
- FILTER: Month/Year (Event) is 13 months ago through one month ago, and [Text Field] Previous Value is whichever groups you are interested in.

Drilling across for more detail
If you want to take this report one step further, you can place it on a dashboard and add a drill report to see more details about the tickets making up those numbers.
- Create a separate report by saving a copy of this report under Options > Save As .
I like to use the naming convention of [Drill-In] Report Name to make the report easier to identify when placing on a dashboard. - Once you've saved the copy, you can make it into a table by selecting the table symbol and then add the other attributes that you are interested in seeing to the report.
Quick tip: Adding a filter for a single day will limit the data returned in this table and allow you to format your report the way you want much quicker. - When you are ready to save the report, you can remove all the filters, wait for the " Report too large to display " error, and then save the report. Don't worry that your report is too large, it will inherit the filters from the top level report on your dashboard and you will get a nice concise table when you drill across reports.
- After saving this report, you will need to go back to the dashboard where your first report lives and go into Edit mode.
- Click on the report, and then the gear icon above it to open the pop-up modal with the drill settings:
- To make this work, select the Avg Time Assigned to Group metric on the left and the new report you created on the right.
- Click Apply , and then save your dashboard changes. Next time you hover over that report, you will be able to click into any of your groups and see which tickets are making up the data for each month.
Measuring Average Time in Solved
To really drive this idea home, let’s have a quick look at another example. Insights comes with some default time based metrics that are useful when measuring the performance of your Zendesk.
- Requester wait time : The combined total time spent in the New, Open and On-Hold status
- Agent wait time : The total time spent in the Pending status
- On hold time : The total time spent in the On-hold status
These metrics are designed under the assumption that you use Zendesk ticket statuses with a particular workflow. Some of you, however, might not use the five statuses (New, Open, Pending, Solved, Closed) in the same fashion as everyone else. In this case, you may want to build your own metrics.
Let's say your agents are setting their tickets to Solved after each update to the customer and each time the customer is replying, the ticket status is being set back to Open. And you want to know, on average, how long your agents spend waiting on your end users to reply. Rather than using the out-of-the-box Agent wait time metric, which measures time in Pending, you can measure this using the [Text Field] Duration in minutes fact.
Again, you will start by building a custom metric and naming it Avg Time in Solved :

Then you can start building the report using the following elements:
- WHAT: Avg Time in Solved
- HOW: [Text Field] Previous Value, [Text Field] New Value, and Ticket ID (if you want to get that granular)
- FILTER: [Text Field] Previous Value is [Status] Solved

This report is showing you the average time spent in Solved prior to each of the statuses it can be changed to. If you are only interested in tickets that went from Solved to Open, you could specify this in your filters as well:

Alternatively, you can build these filters directly into your metric for the statuses you are interested in:

And there you have it! Building reports to look at the duration of certain field values is fun and easy. These techniques can be applied to any ticket field that carries over into Insights, forming an endless variety of ways to use this information to gain valuable perspective into the health of your Zendesk.
29 Comments
Hi there - it's really a great article but unfortunately I am struggling to adjust it to my needs. I am looking for the number of hours a ticket is assigned to an agent (that is not closed, solved or deleted). Somehow it doesn't show any results if I follow the steps like with the group example. Could you please help?
Thanks
Hi Johann,
The metric which you need to use in this case will look like this:
I tried this metric on my test account and can confirm that it returns expected results. Here is a report example:
I have created the ticket #1790068 for you in case you'll need more assistance on this case.
However, there is a downturn when the "[Text Field] Duration in minutes" fact is used for reporting on Text fields, which are not updated so frequently throughout the ticket live.
For example, "Assignee" field might be updated just once on a ticket, in this case, this fact will return a null value. Since it counts the time between 2 text field changes, there should be minimum 2 field updates on the ticket in order to capture the time duration.
To avoid this you can use metric logic described in Duration between two or more ticket events in minutes article.
I was directed to this article by support who suggested it could solve my question on how to report on how long (on average) our tickets are spending in each status before being solved.
I'm not great with MAQL, how would I go about starting this?
Thanks
I think the recipe "How long are tickets sitting with my support groups?" is not correct.
In fact, if I filter the report to just one ticket ID and the ticket moved from G1 to G2, the report just show me the duration on G1. No line for G2 group.
I suppose this is due to lack of event where previous group value was G2 and so no duration is computed.
But I think there should be a way to have this report complete and correct, but I can't figure out how.
Any suggestion?
Hi Matteo...would you mind clarifying what you are expecting in this scenario? The report in question will show you the amount of time a ticket spent in a previous group, so if the ticket is still within G2 and nothing has happened since it's been there, there is no event to calculate any elapsed time.
Hi Greg,
the recipe states "You can answer questions like: How long are agents holding on to tickets? How long do tickets take to cycle through each of your Support Levels?"
I can't find a way to have a complete report to answer the second question. How long, on avarage, a support group holds a ticket?
Since the duration is computed when the ticket group changes, no duration is provided for the last group on the ticket life cycle (the group that has the ticket when it is finally closed).
Do you have a way to have this kind of report?
Thank you
Matteo
Hi Matteo,
I agree that the wording leaves a bit of ambiguity in this recipe and I will pass this to our Documentation team to review this. That being said, if the ticket has not left the final group, there would be no way to report on this with the above metrics. I wish that there were a better answer for this scenario, but there is not going to be a way to handle a calculation of an event that has not yet occurred.
Hello! I was referred to here by one of your email support representatives when I tried to seek help about creating a custom macro where the amount of time tickets spend on New status is measured.
My idea is to deduct the amount of time spent on New status from the Requester Wait Time metric. This is so I can measure the amount of time our agents have spent on working on tickets.
Any advice on this matter will be greatly appreciated.
Hi ,
I Have the same question as Pete Holborow Could you please help us ?
I need a the average time spent on each status of the ticket before it get solved.
Thanks you.
Hey guys -
Zendesk Support can't build custom metrics for you (which is why they sent you to the community) but there are a lot of smart and helpful people here. I'll try to ping a few folks to see if they can weigh in and help you out.
Nicole that would be perfect thank you.
Thank you we really need it , that will be helpful not only for us .
Thanks again.
Okay, I've pinged our moderator team to see if any of them have suggestions.
The average time in each status is tricky as one ticket can move into the same status multiple times or have no instances of a status.
For average time in minutes, I would go for:
So from your note:
Note: This fact only measures the duration for past values. For example, if your ticket status is currently Open, you will not be able to see how long the ticket has been in the Open status.
If ticket has been in T1 after solved in T2, it will take duration of how long ticket is in t2 or not?
Hi Mindaugas,
Thank you for your question. I'm going to need to ask a couple follow up questions that may involve asking some account specific questions so i'm going to create a ticket for you so we can discuss your use case in more detail!
You'll hear from me soon in a ticket!
Hey Sarah,
Is this the time the ticket is sitting with a particular group until it is SOLVED or CLOSED?
Hi Lis! Welcome to the Community!
Can you clarify what you're looking for? I'm not sure what part of the article you're asking about.
Hey Jessie,
In the section: "How long are tickets sitting with my support groups?" is that until the ticket is solved or closed?
Hey Lis! Thanks for clarifying!
This is measuring until the ticket is set to Solved.
Hi there,
How could I calculate average time tickets stay on new or open statuses before moving to hold/solved/pending?
Thanks, Tom!
Hey Tom,
I noticed there hasn't been any movement on your post so I wanted to jump in and offer up the following documentation that goes over setting up a report to show Duration between two or more tickets events in minutes. You should be able to set up a similar report using the instructions provided in the link I've attached.
Hope this helps :)
Thanks Brett I'll take a look.
So how do I do this in the Zendesk Explore?
This is so helpful. I'm trying to create a report that averages all the time different tickets spent in either the new or open status. When I AVG this, it is separating every status change individually, not grouped by ticket. I've created this metric to get the sum for each ticket:
SELECT SUM([Text Field] Duration in minutes) WHERE [Text Field] Previous Value in ([Status] open,[Status] new) AND Ticket Status <> Deleted
But what I can't do now is get the average of this for all tickets. I tried creating this with SELECT AVG(Name of this metric) and it doesn't change it
Any tips?
UPDATE: I may have fixed it. I did a BY statement.
SELECT SUM([Text Field] Duration in minutes) BY Ticket Id WHERE [Text Field] Previous Value in ([Status] open,[Status] new) AND Ticket Status <> Deleted
Seems to work. Hopefully that's correct!
Is it possible to use this to measure the time from when a ticket was created to when a certain tag was added? I'm looking for a way to track when the agent thinks that they submitted the correct response, but don't want to change the ticket to closed.
Steve
Ticket tags are not part of the events and so Insight does not record the time a tag was added. But you can monitor the time for custom fields that have associated tags such as drop downs and check boxes.
This is getting me close to what I"m looking for but I cannot seem to manipulate it correctly to get what I need.
Here is an example
We have a group called IT Support. This is where our help desk tickets automatically get assigned. Once there the tickets are in the new status.
I am trying to generate a report for the average time a ticket stays in the new status for the current month, and a trend line or bar graph of the three previous months.
Any ideas?
Hey Christopher,
It doesn't look like the images came through. Any chance you could try including those again so we can take a look?
Please sign in to leave a comment.