Finding the agent who was the last to update the ticket


  • McCabe Tonna
    Community Moderator


    Would you be okay with changing the assignee to the current agent every time they update a ticket?


  • Vincent Leong

    I am also interested to export a list of zendesk tickets to include the last updater, regardless whether end-user, assignee or requester?

  • Amy Dee
    Zendesk team member

    Hi Carl! Hi Vincent! This type of report should be possible, but it has some caveats. The big one is timing: Insights is not a real time platform. You can only report on the most recent update at the time of the latest data sync. Even on an Enterprise account, data could be delayed over an hour. If you need to see the latest update in real time, I recommend using Views instead.

    For an Insights report, you need to find the update with the most recent timestamp for the ticket. Fortunately, there are default Facts for those timestamps, so you just need to find where they match. You can start with something like this:

    • SELECT COUNT(Ticket Updates) WHERE (SELECT MAX(Ticket updated (minutes)) BY Ticket Updates) = (SELECT MAX(Ticket updated at (minutes)) BY Ticket Id) AND Ticket Status <> Deleted 

    This counts updates where the timestamp of the update is equal to the most recent update timestamp for the ticket (and the ticket is not deleted). 

    Please note: there is a small but critical difference between Ticket updated (minutes) (for ticket updates) and Ticket updated AT (minutes) (for tickets). You need to use both in this recipe, so make sure you have them in the right places. They appear under different headers in the Elements list, which should help you remember which is which:

    This metric counts updates, so it works with (Event) dates and the Updater and Updater Role attributes. That should help you find tickets where the most recent updater (as of the latest sync) was an agent or an end-user. You could combine it with the User (requester) and/or Ticket Assignee attributes to find agents updating tickets they aren't assigned to.

    For more information, check out these articles on building metrics for the events model (for narrowing down an event-based report) and finding the duration between events (for working with update timestamps).

    Please note: These metrics are for demonstration purposes only. Zendesk doesn't support custom code. I can't guarantee them for all use cases, and I strongly recommend that you audit your results.

    I hope this helps! Happy reporting!

  • Andres Figueroa

    Amy Dee can you help me? 

    I wonder why isnt the latest update by assignee in the CSV report extract from the Admin area.  Is there anyway to add it? I am the admin of my site. 

  • Brett Bowser
    Zendesk Community Team

    Hey Andres,

    If you're exporting data from Admin>Manage>Reports then there would be no way to add additional columns to the CSV export. Your best option would be to add the appropriate attribute to your Insights report and export that data. More information on available attributes here: Insights object reference (Professional and Enterprise).

    I hope this helps!


Please sign in to leave a comment.

Powered by Zendesk