Update Handling Time with Agent Comments - Zendesk Explore Calculated Metric
Update Handling Time (With Agent Comments)
Business value & use cases
The Time Tracker app shows the total time spent on a ticket, but this code narrows that down to the time taken for each comment update by an agent.
Helps managers understand how much effort goes into visible customer communication versus internal collaboration.
Makes it easy to compare handling times for public vs internal comments, as well as performance between agents.
Useful for coaching agents, identifying whether replies are taking disproportionately long. Use alongside the general Update Handling Time metric when you need both combined and per-comment views.
Dataset and dependencies
- Dataset: Support - Updates History
- Type: Calculated Metric
- Dependencies: Requires the Time Tracker app (so the "Total time spent" field is populated)
The code
Unlock to view full code
Not sure how to work with the code? Check our getting started guides.
Implementation steps
- Go to Explore > Report Builder > Support - Updates History Dataset > Start Report.
- Select the Calculator icon for Calculations.
- Create two standard calculated metrics, one for public comments and one for internal comments.
- Paste the relevant code above into each metric.
- Validate and save.
- Add them side by side in a report to compare time spent on public vs internal comments.
Validation tips
- Spot-check a ticket with a single public comment: the metric should equal the total time spent.
- Note that it can take an hour or so for Explore's data to refresh before the update appears.
- Add an internal note and re-check: the second metric should now also return a value.
- Compare the sum of both against the overall Update Handling Time metric to confirm alignment.
Caveats and considerations
- Only works if the Time Tracker app is installed and logging time.
- Results are output in minutes. To display in seconds, remove both instances of "/60" (in each code snippet). To display in hours, replace both instances of "/60" with "/60/60" (there are two to be replaced in each code snippet).
- Public vs internal comparisons are most valuable when both comment types are used regularly in your workflows.
Plotted against agent names, you can see how useful it is to visualise which agents are taking more or less time to respond with each type of comment.
Example chart
Example showing per-update handling time for public and internal comments across agents