In this Explore recipe, you'll learn how to create a query that helps determine which agent was assigned to a ticket when the requester filled out the satisfaction survey. If you haven't enabled satisfaction surveys, see Using CSAT.
What you'll need
Skill level: Easy
Time Required: 15 minutes
- Zendesk Explore Professional or Enterprise
- Editor or Admin permissions (see Giving agents access to Explore)
- Ticket data in Zendesk Support
Creating the query
To create the query
- In Explore, click the query (
) icon.
- In the Queries library, click New query.
- On the Choose a dataset page, click Support > Ticket updates > Support: Ticket Updates, then click New query. Query builder opens.
- In the Metrics panel, click Add.
- From the list of metrics, choose Updates > Updates, then click Apply.
- In the Rows panel, click Add.
-
From the list of attributes, choose the following:
- Ticket field changes > Changes - Field name
- Customer satisfaction > Ticket satisfaction rating
- Ticket field update values > Update ticket assignee
- Ticket > Ticket ID - When you are finished, click Apply.
-
Click Changes - Field name, then on the Selected tab, tick satisfaction_score. This will filter the results to show only changes to the satisfaction rating.
-
Click Ticket satisfaction rating, then on the Selected tab, tick good and bad. This will filter to show when a change was made to the satisfaction score, either good or bad.
You've finished the query. Your results will look like the screenshot below:
Next steps
The next steps are optional for a new query and should be used if you want to see specific instances where ratings were changed from good to bad, or vice versa.
- Open a new query in the same dataset as above, Support: Ticket updates.
- In the Metrics panel, click Add.
- From the list of metrics, choose Customer satisfaction > Bad to good satisfaction ratings and Customer satisfaction > Good to bad satisfaction ratings, then click Add.
- In the Rows panel, click Add.
- From the list of attributes, choose Ticket field update values > Update ticket assignee and Ticket > Ticket ID, then click Add.
- From the Result manipulation (
) menu, click Metric filter.
- On the Metric filter page, set each metric range to filter out results less than one. For more information, see Selecting the metric result range.
See the screenshot below for an example of this query.
9 Comments
Thanks for this report recipe Jessica. Very helpful!

I might be wrong but I think the instructions for the recipe say to add ticket satisfaction rating in rows but in your end state report it states to use Changes - new value instead.
For me - I'm trying to see who is the assignee for each satisfaction rating update so am using Changes - new value field in the row.
Not sure if this was a typo and needing fixing etc :)
If a ticket is rated, and then the assignee changes after this (e.g. if escalated to a manager due to bad CSAT), will the satisfaction rating then be attributed to the other person?
Hi Oscar
You are correct, if a ticket has a CSAT and then is re-assigned to another user, that CSAT will follow the ticket. We noticed this happening when we had agents out of the office, so we are very careful to re-assign to the person it should be credited to.
Hi Chris,
Is there a way ( maybe a trigger ) that we cans et so it would not do it. We have a Tier system and tickets ( when escalated ) will always carry the CSAT with them. Which seems to be unfair for Tier2 /and 3 agents.
Hi Melanie Scarth, I'm not sure what your use case is but you should be able to update the automation.
It sounds like what is happening now is that a Tier 1 agent replies to a user and then escalates to Tier 2, while Tier 2 has the ticket, the Tier 1 CSAT gets sent, which re-assigns the ticket back to Tier 1?
You could do a series of CSATs one for each tier that go out at staggered times. You could add a condition to your escalation (again this is dependent on your system, but if you're using a macro to escalate then you could add a tag to that macro that delays CSAT until the end of the interaction). You could set the automation to trigger only after final resolution.
If you can describe your process more, I could help you determine how best to do this. In our instance, when we are escalating we use macros. Those macros add the tag no_csat which both pauses the sending of the CSAT and checks the No CSAT box on that ticket. If a different tier solves the ticket with one of our Resolution macros, then it will kick off CSAT or they can manually remove the checkmark if they feel that it is appropriate.
Jessica Blake,
I'm trying to get just a list of rated good tickets by ID excluding certain topics. And everything works except when I apply the TICKET ID requirement.
I've also added count of tickets just in case - but no options work. I've tried in both the tickets dataset as well as the tickets updates dataset - but adding in the ticket ID removes all results. Not sure if this is a bug - or why explore won't return good satisfied comments with ticket ID's
Any help would be appreciated
Bart
Hi Bart, it's definitlely possible to do what you're trying to do. I suspect that your query is returning to many rows, and that's why it's blank. If this is the case you'll see a red warning message at the bottom of the query pane.
A couple of suggestions that should help:
If you only want to see tickets that have a comment you should select the COUNT(Good satisfaction tickets w/comment) metric. You'll then need to set the metric filter to only show rows where the value for that metric is one.
Hopefully this gets you where you want to be.
Heya Chris Stock,
Thanks for the suggestions. We've only used it for a few months, but adding in a filter actually populated it.
One thing that doesn't work however is if I add to the filtered sections an option to exclude a specific custom field like the ticket topic, it still returns tickets that have this topic.
I thought I'd try the same by adding to the filter the exclusion by tag, but it still populates the report if even when the tag is on the ticket.
I will continue to tinker with it.
Thanks again for the quick update
There's no reason that shouldn't work. I've tested it on my account and can exclude tickets with certain values in our custom fields. Try the metric filter if you haven't already, otherwise it might be that there is an issue with your account that Zendesk need to take a look at.
Please sign in to leave a comment.