Insights tag reporting: Reporting on tickets with one or more tags (Professional and Enterprise)

Have more questions? Submit a request

86 Comments

  • Cristian Vleeming

    I can't really find an easy solution for my question.

    I want to create a metric that checks for tickets that have these two tags: tag1 and tag2.

    So i created "SELECT # Tickets WHERE Ticket Tag = tag 1 AND Ticket Tag = tag2" but this doesn't work.

    What am i doing wrong?

    0
  • Mindaugas Verkys

    Hi Cristian, 

    you have to write different select for each tag. 

    0
  • Cristian Vleeming

    Hi Mindaugas,

    You mean within 1 metric different selects?

    0
  • Mindaugas Verkys

    Yes, you can do in one metric, or create in 3 separate metrics, important that for one tag one SELECT. 


    SELECT IFNULL((Select # Tickets Where Ticket Tag = {{TAG1}} ), 0)

    SELECT IFNULL((Select # Tickets Where Ticket Tag = {{TAG2}} ), 0)

    after when (first=1) and (second=1) = 1 else 0

    0
  • Cristian Vleeming

    Hi,

    Thanks.
    But i don't really get it to work :(
    I have the following:

    SELECT IFNULL((SELECT # Tickets where Ticket Tag = TAG1),0)
    SELECT IFNULL((SELECT # Tickets where Ticket Tag = TAG2),0)
    after when (first=1) and (second=1) = 1 else 0

    But i get this error when i want to add it:
    "Unexpected 'SELECT'. Expecting: ;"

    0
  • Mindaugas Verkys

    The last part wasn't for copy/paste. In one metric it should look like this:

    SELECT # Tickets WHERE

    (SELECT IFNULL((SELECT # Tickets where Ticket Tag = {tag1}),0))=1

    AND

    (SELECT IFNULL((SELECT # Tickets where Ticket Tag = {tag2}),0))=1

    0
  • Violeta Micu

    Hi everybody,

    Is there any possibility to create a report based on Ticket Tag where to count all the Tickets that have a certain word included?

    I tried the following and it brings dates but not the needed ones.

    Basically i need a dashboard in Zendesk that will show a count on subcategories. I didn't find a way using the categories label and that is why i am trying to use the Ticket Tags with all the correspondents that they have in subcategories.

    Is it possible to obtain somehow a subcategory report?

    Thanks a lot!

    Violeta

    0
  • Amy Dee

    Hi Violeta! It is possible to report on ticket tags based on text strings. You're on the right track, but you're missing a couple key details.

    First, you can't just use SELECT COUNT (Ticket Id) for this type of metric. Tag data is stored in its own dataset, and the metric must define the connection that dataset. This relationship is already defined in the default # Tickets metric.

    The article above covers the relationships between the datasets and how to use # Tickets in a filtering metric. We also have a recipe that covers reporting on tag labels here: Insights recipe: Reporting on multi-select fields using tags. (If you're not using a multi-select field, you can skip to the tag label metric part of the recipe.)

    If you're using a dropdown field with nested values, you can use text strings with the field value instead of the tags. That would give you more flexibility in a larger report. We have details for that approach here: Insights recipe: Reporting on nested drop-down fields.

    I hope this helps! Happy reporting!

    0
  • Violeta Micu

    Thank you very much for your fast response Amy. 

    Regarding the nested fields, i already create a report with metrics for each one of the categories and yes it is useful but it only tells me: How many Subcategories are included in each Category (please see the pic below).

    The view that i need now is regarding the number of tickets where it was used a subcategory that contains the word "Refund" without taking into account the Category. I might need to mention that i have the same subcategories in 15 categories and i want to count all that subcategories :). 

     

    Thanks,

    Violeta

    0
  • Violeta Micu

    Hi again,

    It's fine i created the report on subcategories as i need with this one: 

    • SELECT IFNULL((Select # Tickets Where Ticket Tag [Ticket Tag] ILIKE "%refund%" ), 0)

    for each one of my subcategories.

    Thank you very much. I am so happy :D

    Have a nice day!

    Violeta

     

    2
  • Mindaugas Verkys

    Hi Violeta,

    Should be something like that:

    SELECT IFNULL((Select # Tickets Where Ticket Tag [Ticket Tag] ILIKE "%refund%" ), 0)

    0
  • Violeta Micu

    Yes Mindaugas that is what i used (i corrected the message from above). Thanks :)

    0
  • Ronnel Grimpula

     

    Hello everyone,

     

    It's actually a little off from the topic.

    Is there a way i could get the total time the agents spent on the ticket/s? and also get the total time the agents worked throughout their shift in zendesk?

    0
  • Karsten M. Jensen

    Hi everyone,

    I'm trying to look up the count of tickets/chats that have two (in this case) specific tags.

    Reading the comments made me try:

    SELECT # Tickets WHERE (SELECT IFNULL((SELECT # Tickets where Ticket Tag = smartaid_cancellation),0))=1 AND (SELECT IFNULL((SELECT # Tickets where Ticket Tag = smartaid_transferred),0))=1

    But I keep getting the error:

    Unexpected end of string. Expecting one of: ELEM_IDENTIFIER, FUNCNAME1, NEXT, OBJECT, STRING, -, ZERO, IF, RANKFUNCNAME, PREVIOUS, FUNCNAMEN, COUNT, RUNFUNCNAME, REAL, IDENTIFIER, FUNCNAME2, CASE, PERCENTILE, FUNCNAME12, TEXT_ELEM, THIS, NATURAL, SHORT_STRING, REPORT, (, IFNULL

    I actually get that error no matter which metric I try.

    0
  • Graeme Carmichael

    Karsten

    I know this is not very intuitive, but you cannot just paste the code for the custom metric into the editor. Instead, you must select each item from the element window on the right hand side.

    You can see an example here.

    0
  • Lucas Vocos

    Hi, I'm curious if the comment made here by Martin was still relevant:

    "Can you track the time in (days or hours) from when the specific tag was added and report it? If not, what would be a work around? I am trying to create a report to see how long a ticket "sits" in a specific stage. Thanks!"

    My support team will work as Tier 1 & Tier 2. Tier 3 will be one of three different organizations within my company. I want to report how long a ticket "sits" at any given state. (i.e. time spent with engineering to close)

    Instead of reporting on tags (we currently report off jira_escalated when tickets are escalated via the JIRA integration), we should create custom fields? And then track the time between events?

    0
  • Amy Dee

    Hi Lucas! Tags are not connected to ticket events, so there's no way to see when a tag was added or removed. You can only report on whether tags are currently present or not.

    In an escalation workflow, like Tier 1 to Tier 2 to Tier 3, I recommend using ticket groups. Groups give you more routing options within the Zendesk Support interface (including sorting your agents and controlling permissions), and they allow you to report on how and when the group changed. 

    However you approach your workflow, though, you'll need to capture it in a synced ticket field if timing is important. Since you're working with tags, the smoothest transition would be with a checkbox or dropdown field.

    Once you've moved to a ticket field, you have a couple options for finding durations:

    I hope this helps! Happy reporting!

    0
  • Lucas Vocos

    Thanks Amy!

    Some of these "Tiers" aren't in Zendesk (Engineering, Sales teams, etc.). We'l be using T1 & T2 as routers to specific areas, so I think I'll incorporate a drop-down in this case. 

    So, let's say I want to measure length of time from a Tier change (drop-down selection) to close, would that be two events recipe? 

    0
  • Mindaugas Verkys

    Hi Lucas,

    It's complicated but you can count also the tags. You need to find a Timestamp MIN update where ticket has that TAG, after just count difference between two timestamps. Of course it's easier to count by adding ticket fields values, we updating some of ticket fields in background without adding them into ticket form. 

    0
  • Amy Dee

    Hi Lucas! For the use case you describe, that would use the duration between two events recipe.

    You'd look for the first time the dropdown changed to (or from) a certain value, then compare it with the solve timestamp. Fortunately, there's a default fact for the solve - Ticket solved at (minutes) - which should make that part of the metric easier. (Defining a solve by event is surprisingly tricky.)

    Keep in mind, if you want to see durations within your "Tier" dropdown field, use the "duration of a text field" recipe. It's much easier overall, and it's more dynamic to field changes. You only need to use the two timestamps version when you compare the field with the status (or some other change).

    I hope this helps! Happy reporting!

    0
  • Carlos Santos

    Hi everyone.

    Is there a way to get a list of tickets by using an events-based metric but then encapsulate it in another metric so we can use "ticket tag" in the "How" tab?

    For instance, I have this metric that basically gives me all closed tickets with certain specific characteristics (it's not the best example as I know I could select the same tickets using a metric that doesn't use events but please forget about that for now, it's for other reasons):  

     

     

    This metric allows me to have a list of ticket IDs and use it in a table report to list them all or to show the total count. However, what I need is to take those tickets and produce a report that shows me how many of them have specific tags. Much like this:

     


    So what I tried (doesn't work - report is not computable or similar...) is to have a metric that encapsulates the initial one like this:

     

     

    My idea was to use "# Tickets" (that allows "Ticket Tag" to be used in the "How" tab) but using the initial events-based metric as a filter so that only the ticket list I'm interested in would be shown in the report. 

    But I can't get it to work.

    Is there something I'm doing wrong? A better approach? Or is it just impossible?

     

    Thank you.

     

     

     

    0
  • Amy Dee

    Hi Carlos! You're on the right track here. The conflict comes from that "BY Ticket Id" element - it pulls the metric back out of the ticket tag dataset. You need to get everything to TicketTagId to slice by Ticket Tag under HOW.

    Try making this adjustment:

    • SELECT # Tickets WHERE (SELECT (SELECT #Tickets - BASE LOGIC (FH, SF) - v2 BY Ticket Id) BY TicketTagId) >=1

    In my tests, this allowed me to add Ticket Tag under HOW and see how many tickets had each tag.

    This approach works because the Tickets dataset (BY Ticket Id) is directly connected to the tags dataset (BY TicketTagId), so you can shift any ticket metric up to the tags dataset.

    You may need one extra piece, though. As it is, this report would find tickets that are counted in your "BASE LOGIC" metric, then show you ALL tags from those tickets. It wouldn't be limited to the tags you have in the #Tickets - SCOPE (SF) filter.

    If you want to limit the report to just those tags, you need to add them to this metric as well:

    • SELECT # Tickets WHERE (SELECT (SELECT #Tickets - BASE LOGIC (FH, SF) - v2 BY Ticket Id) BY TicketTagId) >=1 AND Ticket Tag IN (tagsfromscopemetric)

    I hope this helps! Happy reporting!

    0
  • Andrei Kamarouski

    Hi @Amy, 
    Is there any way to report on ticket updates with one or more tags? Looks like Ticket Tag attribute should lock the data on Ticket level without breaking down further to Update level. 

    0
  • Amy Dee

    Hi Andrei! Tags are indeed locked to the ticket as a whole; they are not connected to ticket events. There is no way to aggregate tag data by ticket update or report on when a tag was added or removed. You can only report on whether a tag was ever present on a ticket, and whether that tag is still present now.

    If you need to report on changes within individual updates, you'll need to use ticket fields instead. As long as it isn't a multi-line text field or a multi-select field (which don't sync), you can report in individual changes using the events model.

    I hope this helps! Happy reporting!

    0
  • Andrei Kamarouski

    Hi Amy, 

    yes, this answers my question completely! Thank you. 

    0
  • Sebastien Quintallet

    Hi Amy and Everyone,

    For my Team, I have now a process where they have to add 2 tags to a ticket when a customer contacts us for an article damaged:

    • One tag is: Name of the article (Over 30 possible values)
    • Another tag is: Type of the damage (Over 10 possible values)

    I am trying to create a table with 2 entries which shows the numbers of tickets tagged with every possible combinations of both tag values (#occurences of article 1 with damage 1, #occurences of article 1 with damage 2, etc.)

    This is ideally how it could look like:

    I have read through the questions asked before and I could not quite figure the way to do it. The only way I can think of would be to create a metric for every possible combination (Article + Damage type) but that would take a huge time.

    What would be the best way to get to the result? Thank you so much.

    Sébastien

    0

Please sign in to leave a comment.

Powered by Zendesk