Tags are words, or combinations of words, that you can use to add more context to tickets. You can assign tags to tickets, users, organizations, and chats. You create, assign, and manage tags in the Zendesk Support console.
Tags are stored differently than other Zendesk objects and might require more consideration when you use them to generate reports. For example, while a ticket can be in only one group or have only one status at a time, a tag can be added to multiple tickets and a single ticket can contain multiple tags.
In this article, you'll learn how you can use tags in your Explore reports and see some examples. You'll also find out what tag information is collected by Explore. For an in-depth look at tags, see About tags.
This article contains the following topics:
Examples for using tags in reports
These examples illustrate the basic operations you can perform with tags in your Explore reports. The Ticket tags attribute is used throughout, but you can apply the same principles to any other tag attribute.
If the tag you intend to use is automatically generated by a field (like drop-down lists, multi-select lists, and checkboxes) consider using the custom field attribute instead. Custom field values load faster and have easily identifiable values. For more details, see Reporting with custom fields.
This section contains the following examples:
Reporting on all ticket tags in use over the last 30 days
This is a simple report that shows all of the ticket tags you're using and the number of tickets that are associated with each tag for the last 30 days.
To show all ticket tags in use over the last 30 days
- Open a new report using the Support - Tickets dataset.
- In the Metrics panel of the report builder, add the metric COUNT(Tickets).
- In the Rows panel, add the attribute Ticket tags.
- In the Filters panel, add the attribute Ticket created - date.
- Click the Ticket created - date filter and configure the date range for the last 30 days.
Your chart will look similar to the following example. You can click the Tickets column heading to sort the list by ascending or descending number of tags.
Reporting on ticket tags using filters
In this example, you'll create a report that uses a filter to return only tickets that contain a specific tag (in this case, checked_by_manager).
Before diving into the example, there are a few important things to note:
- If you want to filter by multiple tags at the same time, use the formula in Finding tickets with multiple tags instead. Selecting multiple tags in the Filters panel multiplies the report's metric values by the number of matching tags. For more information on why this happens, see Why do my metric values increase when I filter my report by multiple tags?
- If you want to check which items don’t have one or more tags, use the formula in Finding tickets that don't have a tag instead. You can't use report filters to exclude tags.
To create the report
- Open a new report using the Support - Tickets dataset.
- In the Metrics panel of the report builder, add the metrics COUNT(Solved tickets) and COUNT(Unsolved tickets).
- In the Rows panel, add the attribute Ticket group.
- In the Filters panel, add the attribute Ticket tags. Then, click this attribute to open the filter menu.
- Select the tag you want to show in the report (in this case, checked_by_manager).
You'll see a count of tickets that contain the tag you chose.
Reporting on ticket tags using standard calculated metrics and attributes
In this section, you'll learn how to use functions that give you much more power and flexibility when reporting on tags. The basic tag reporting operations are:
- INCLUDES_ANY: Returns tickets with at least one of the supplied tags.
- INCLUDES_ALL: Returns tickets that have all supplied tags.
- NOT INCLUDES_ANY: Returns tickets that don't include one of the supplied tags. If the ticket includes any of the supplied tags, it's excluded.
- NOT INCLUDES_ALL: Returns tickets that don't include all of the supplied tags. The ticket must contain all of the supplied tags to be excluded.
To use these examples, you'll need to be familiar with standard calculated metrics and attributes and understand how to write formulas. Additionally, you can use the wildcard (%) character before or after a tag to return matching results.
This section contains the following examples:
- Finding tickets containing a tag
- Finding tickets that have one of two tags
- Finding tickets with multiple tags
- Finding tickets that don't have a tag
- Finding tickets that have one tag, but don't have another tag
- Finding tickets that contain a specific string in one of their tags
- Finding tickets with no tags
- Returning specific values when a certain tag is present
- Filtering a specific tag from all metrics on a report
- Using INCLUDES in a standard calculated attribute with multiple conditions
- Using INCLUDES in a standard calculated metric
Finding tickets containing a tag
In this example, you want to find tickets that have the tag "united_states". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (INCLUDES_ANY([Ticket tags], "united_states")) THEN True ELSE False ENDIF
Finding tickets that have one of two tags
In this example, you want to find tickets that contain one of the tags "australia" or "japan". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (INCLUDES_ANY([Ticket tags], "australia", "japan")) THEN True ELSE False ENDIF
Finding tickets with multiple tags
In this example, you want to find only tickets that have both of the tags "united_states" and "italy". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (INCLUDES_ALL([Ticket tags], "united_states","italy")) THEN True ELSE False ENDIF
Finding tickets that don't have a tag
In this example, you want to find only tickets that don't have the tag "germany". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (NOT INCLUDES_ANY([Ticket tags], "germany")) THEN True ELSE False ENDIF
Finding tickets that have one tag, but don't have another tag
In this example, you want to find tickets that contain the tags "greece" and "india", but don't contain the tag "ireland". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (INCLUDES_ALL([Ticket tags], "greece","india")) AND NOT INCLUDES_ALL([Ticket tags], "ireland") THEN True ELSE False ENDIF
Finding tickets that contain a specific string in one of their tags
In this example, you'll use the wildcard character % to find tickets for which the requester tags contains the string "king". Create a standard calculated attribute with the following formula and use it as a filter in your report.
IF (INCLUDES_ALL([Requester tags], "%king%")) THEN True ELSE False ENDIF
Finding tickets with no tags
In this example, you'll create a standard calculated attribute and use it as a filter. This attribute returns the string "No tags" for all tickets that don't have any tags and "Has tags" for tickets that do have tags.
Use the following formula in a standard calculated attribute:
IF (INCLUDES_ANY([Ticket tags], "%")) THEN "Has tags" ELSE "Does not have tags" ENDIF
Returning specific values when a certain tag is present
In this example, you'll see how you can create a standard calculated attribute that tests for the presence of the tag "hawaii" and returns the text "Aloha!" when it is found. If it's not found, the formula returns "Hello". You can then use this in a filter, or add it as an attribute to the Rows or Columns panels in the report builder.
Use the following formula in a standard calculated attribute:
IF (INCLUDES_ANY([Ticket tags], "hawaii")) THEN "Aloha!" ELSE "Hello" ENDIF
Filtering a specific tag from all metrics on a report
In this example, you've created a report that contains several metrics. You want to exclude all tickets that contain the tag Alaska from your results.
Use the following formula in a standard calculated attribute:
IF (NOT INCLUDES_ANY([Ticket tags], "Alaska")) THEN "true" ELSE "false" ENDIF
Now, add this attribute to the Filters panel of your report. Click the attribute you just added and configure the filter to only show True values.
Using INCLUDES in a standard calculated attribute with multiple conditions
- If the ticket contains either of the tags "united_states" or "canada", the attribute returns North America.
- If the ticket contains any of the tags "germany", "france", or "uk", the attribute returns Europe.
- If the ticket contains either of the tags "china" or "japan", the attribute returns Asia.
- If none of the tags are found, the attribute returns Other.
Use the following formula in a standard calculated attribute:
IF (INCLUDES_ANY([Ticket tags], "united_states", "canada")) THEN "North America"
ELIF (INCLUDES_ANY([Ticket tags], "germany", "france", "uk")) THEN "Europe"
ELIF (INCLUDES_ANY([Ticket tags], "china", "japan")) THEN "Asia"
ELSE "Other"
ENDIF
Using INCLUDES in a standard calculated metric
IF (INCLUDES_ANY([Ticket tags], "united_states")) THEN [Ticket ID] ENDIF
Reporting on macros using tags
For an example of how you can report on macro usage by using tags, see Explore recipe: Reporting on macros using tags.
Tag information collected by Explore
The tag information collected by Explore varies depending on the dataset you choose, but includes one or more of the following attributes:
Attribute name | Description | Datasets available in |
---|---|---|
Ticket tags | Returns the tags associated with a ticket. |
|
Assignee tags | Returns the tags associated with an assignee. |
|
Requester tags | Returns the tags associated with the user who requested the ticket. |
|
Submitter tags | Returns the tags associated with the submitter of the ticket. |
|
Ticket organization tags | Returns the tags of the organization associated with the ticket. |
|
Requester organization tags | Returns the tags associated with the organization of the ticket requester. |
|
Updater tags | Returns the tags of the user who updated the ticket. |
|
Updater organization tags | Returns the organization tags of the person who made the ticket update. |
|
Agent tags | The tags associated with the agent for the Knowledge or Knowledge Capture event. |
|
Call agent tags | The tags associated with the agent for a Talk call. |
|
Leg agent tags | Returns the Talk call leg agent's user profile tags. Each person that engages in a call has their own interactions with the system and are considered a different leg by the system. |
|
Organization tags | Returns the organization tags of the call end-user. |
|
Chat tags | Returns the tags applied to a particular Chat session. |
|