# Explore recipe: Tracking ticket assigns across groups

If my organization has dozens of groups, how can I calculate the total number of tickets that were assigned to a specific group (and solved by any group)? I have tried the following formulas, filtering them to tickets created in 2021 for easier verification.

Formula 1 - Seems like the logical option for organizations with a large number of zendesk groups, but displayed a wildly inaccurate number in the single digits.

`IF ([Changes - Field name] = "group_id" AND[Changes - Previous value] = ANY AND[Changes - New value] = "999xxx") THEN[Update ID]ENDIF`

Attempt 2 - The outputted value was wildly inflated. I also would prefer not to use this method because it would require adding each group ID individually and it would remain a static list requiring manual updating if new groups are created.

`IF ([Changes - Field name] = "group_id" AND ([Changes - Previous value] = "1xxxxx" OR  [Changes - Previous value] = "12xxxx" OR[Changes - Previous value] = "123xxx" OR[Changes - Previous value] = "1234xx" OR [Changes - Previous value] = "12345x" ) AND[Changes - New value] = "999xxx") THEN [Update ID]ENDIF`
Zendesk Customer Care

Hi @...

Thanks for reaching out! To confirm, it sounds like you are looking for a sum of solved tickets that are assigned to a specific group, even if they were marked as solved by someone outside of that group? Is that correct?

Hello @..., yes that is correct! We're trying to figure out how often tickets are being assigned to a group and someone outside of that group is solving. This would help us identify how often tickets are being assigned to this group incorrectly or how long this group spent on tickets without being the one to solve it. Thank you!

Where do we find an index of Group IDs so we can match them to their names?

Zendesk Digital Resources Team

Hello James,

Group names and Ids can be obtained through our API's, List Groups endpoint to obtain those references.

Alternatively, through Manage > People in Support, the Groups tab will have each group's name listed. Here, the group name itself is a hyperlink with the group's ID encoded at the end of the URL.

Hi,

Which time filter should I use to see the amount of group assignments for a specific date?

Zendesk Community Manager

Hi Marcos -

To limit the results to changes on a specific date, you'd want to add a filter using Ticket updated - date

When using the custom metric, I am able to accurately capture tickets assigned from one group to another.

I'm trying to get a sense of how many tickets are assigned to a particular group by date. I attempted using the "Update - Ticket Date" attribute, but that seems to attribute a count to the date a ticket was most recently updated which was assigned to that group.

There is a "Ticket Assigned - Date" attribute which is almost what I'm looking for, but it doesn't properly account for tickets assigned to a group but not yet an individual agent.

If there were a "Ticket GROUP Assigned - Date" attribute, I think that would help answer what I am looking to understand. Is there a way to write a custom attribute of this nature? Or is there another way to understand, by date, the tickets that were assigned to a particular group?

Community Moderator

Hey @... - Have you tried using the 'Update - Date' attribute? This date attribute will adapt to the specific update your metric is about so, in this specific case, it would be the date in which the ticket was reassigned to that specific group.

I have a similar query I am really struggling with.

I have over 900 groups with my instance of Zendesk with 100's of triggers that assign a ticket to the initial group.

What I am trying to identify is

First group   |    Second group   |    Total

ABC             |         DEF             |      20

EFG             |         DEF             |      19

ERF             |         HUI              |      15

For last week

This is so I can see if I can intervene and provide a solution that means the tickets don't have to be moved and improve our FTR (first-time resolution)

When I run the queries I get a lot of entries where the ticket started in group 1 went to group 2 then back to group 1.
The result is then
Group 1 to group 1 = 2266 tickets

If I exclude these tickets that came back to the original group then I am losing the data of where it went from the first group to the 2nd group. I could am then missing possible opportunities to improve a process and have a single group deal with a specific issue.

Thank you for all the help

Hi Glen - we will need additional information in order to assist with your query. I'll be creating a ticket for this and reach out to you on that ticket shortly!

Warm regards,
Love Penuliar | Associate Premier Support Engineer - Manila

Hi,

thanks a lot, this is very helpful.

In our environment we're escalating tickets to "Tech Support" group from different groups, so from the formula I removed the "previous value" and now it looks like this (obviously I changed the group ID)

`IF ([Changes - Field name] = "group_id" AND [Changes - Previous value] = "36000000xxxx" AND [Changes - New value] = "3600000xxxxx") THEN[Update ID]ENDIF`

When a tkt is updated, the "Tech Support" team assigns it back to the original owner, so I added a row with the Assignee name to see who's the owner of the escalated ticket.

However, I'm trying to see also the actual ticket IDs of the tickets but if I add the Ticket ID as a Row it shows all the tickets, regardless if they've been assigned to the group or not.
How can I add the Ticket ID to the output to see how many and which tickets have been assigned to the specific group?

Thanks a lot!

Hi Team,

The above formula helps to track reassignments to the group only . Is there a way to include another command to indicate if the ticket was also solved in the new group? only then the formula returns results?

Example: I want to track how many tickets were assigned from Group A to B. Ticket is assigned from Group 'A' to Group 'B'. Then it is re-assigned back to Group 'A'. The above formula calculates this option of assigned from 'A' to 'B'. However if the same ticket was reassigned back to Group 'A' and solved there; is there a way to exclude tickets which were assigned back and solved in the Previous Group value?( in this case its 'A')

Zendesk Engineering
@Rob C.

Most of the time when you add ticket ID attribute it will behave the way like you experienced. What you need to do is just go to Result Manipulation > Metric Filters and remove 0 from the results. It will then filter out your results to show only the updated tickets specified on your calculated metric.

Zendesk Engineering
@Francois,

As long as the Group ID values is correct, the formula should work without a problem. If in case you have already verified that it was indeed the correct group ID, feel free to Message us and we'll investigate on it further.

Dane, thx I was in the wrong query type.

I'm having some struggles with something maybe easy for the community.

Currently I'm looking to the cases assigned to group X.

It is working well, but when I drill in, I see that some "TICKET IDs" Aren't unique, some tickets have been assigned multiple times to that specific group.

How can I count each ticket ID as 1 in place of 2, 3,...

See screenshots:

Decompose, tickets ids with more than 1 as result:

Screenshot 2: What of course has impact on the results provided:

Zendesk Engineering
@Francois,

If you are seeing 2 values for your created formula, it only means that the ticket was assigned to the group two times.

Dane

I understood this, but I want to see unique values only.

Only if this "happened" or "not happened" on a ticket.

I don't care that it was assigned 20x times to that specific group. (thats usefull for another charts, for example to analyse & solve pingpong of cases)

Taylor Bowser Was a solution ever provided for Dustin's issue at the beginning of this thread? I'm trying to solve the same problem.

Ended up trying the following:

`IF ([Changes - Field name] = "group_id" AND[Changes - Previous value] != "999xxx"AND[Changes - New value] = "999xxx") THEN[Update ID]ENDIF`

I'm not sure how to control to tickets counted twice i.e. we assigned to the same group more than one over the course of the ticket's lifetime.

Stephen Gallagher

You can "dig in" to see the tickets that have been assigned more than onces.
If you only want to see cases assigned more than once, just change the result starting from "2" in place of "1" (in Metric filter)

Thanks François Spinnael!

Correct - using the Metric filter can show me those tickets that have been assigned to a given group more than once.

For my use case, I'm trying to do what you have described above:

Only if this "happened" or "not happened" on a ticket

For my sample group, here is the trouble that I'm running into:

• Using the formula above, the COUNT returns 612 results.
• When I add Ticket ID to Rows (to see the ticket numbers), it returns 579 rows.
• Using Metric filter to look at tickets assigned more than once, I get just 10 tickets assigned twice (and none above twice) which, to me, means the COUNT should actually return 589 occurrences of tickets being assigned to my given group.

I'm not sure where the difference of 25 between 612 and 589 is coming from.

I believe deleted tickets lose their Ticket IDs, which could be the reason for the difference described above: https://support.zendesk.com/hc/en-us/articles/4408827553690-Why-are-there-ticket-IDs-missing-

Stephen Gallagher

Any idea how we could count tickets ID with "2 times assigned to" as "1" ?

François Spinnael not yet :(

I'm wondering could someone on the Zendesk team give us a steer?

Zendesk Engineering
@Francois and Stephen,

I'm currently testing it. I'll provide an update as soon as I have the result.
Zendesk Engineering
@Francois and Stephen,

Instead of using Update ID, please try to use Update Ticket ID on the formula. This way, it will only return the result for the ticket and not the events on the ticket.

``````IF ([Changes - Field name] = "group_id" AND
[Changes - Previous value] != "999xxx"AND
[Changes - New value] = "999xxx") THEN
[Update Ticket ID]
ENDIF``````

Excellent, Dane - thank you!

It's worth noting (for anyone with the same issue) that this worked (for me) only after I used D_COUNT. The steps at the top of the article refer to COUNT.

Thanks guys! it works

Hello,

Do you know how it's possible to count the transfered ticket from one group to another groupe whitout creating each request on Explore ?

My idea is to know the transfered ticket from my group A to my group B C D

Thanks !