This article shows how to push tasks data into a Zendesk ticket which can then be used to create workflows, build Zendesk views, Explore reports or be used in macros or even other apps!
Steps to take to collect task data are:
1. Identify what data you need.
2. Create ticket fields that will store that information.
3. Configure the tasks app to feed data into your new fields.
4. Hide the Zendesk data fields so that they can only be updated by the app.
Step 1: Identify what you want to report on.
There are many things you may wish to record on the ticket on as a result of task activity. In order to figure out what data you need you should start with either a question or a desired outcome. For example:
- What number of tasks does each agent have assigned?
- How many tasks has each agent completed?
- What percentage of tasks does each agent still have to complete?
- How many tasks does each department do each month?
- How much time did it take to complete each task in minutes.
- You need to see a history of who did what with each task on a ticket.
Step 2. Create ticket fields that will store task information.
Luckily Zendesk already has great instructions on how to create custom ticket fields here.
Now create the custom fields that will record the data you want. For example if you want to record the total number of tasks that are on a ticket, create a number field called "Total no. of tasks". Or if you want to see a history of who did what on each task, create a multi-line text field called "Tasks Activity".
The main thing to note when creating custom fields is to ensure you choose the right field type. This is particularly important for building reports in Zendesk Explore. If you choose the wrong field type, then your data may end up in Explore in the incorrect format (ie. attributes instead of metrics or vise versa - learn more about metrics & attributes here).
Step 3. Set the tasks app to feed data into your new fields.
Now that you have the fields you want to store data in, click into Tasks admin in the main left bar. Then under Settings, click add event and select Task status changed from the Ticket updates dropdown.
Now click + Add ticket field(s)... and select one of the fields you created like this:
Now hover over the field and on the right you will see a + icon. Click this icon to bring up a menu of example task data you would like to use like this:
Now repeat this for the other fields and click Save settings at the bottom.
Finally create some tasks on a ticket and test to see if the fields are updated with the correct numbers.
IMPORTANT: Note that you are not limited to using just what is offered in the popout list. These are suggestions of how to use Liquid Markup which is the underlying tool for selecting the data you want.
You can structure the data in new ways too!!
For example, if you want to see a full history of tasks fed into a multi-line text field like this:
You could use the following code:
{% capture newline %}
{% endcapture %}
{%- for task in ticket.tasks -%}
{%- if task.task_list.id != last_id -%}
{{newline}}*** {{task.task_list.name}} ***{{newline}}
{%- assign last_id = task.task_list.id -%}
{%- endif %}
{%- if task.is_marked_as_not_doing -%}
[X] {{task.name}} (by {{task.marked_as_not_doing_by.email}})
{%- elsif task.is_completed -%}
[✔] {{task.name}} (by {{task.completed_by.email}})
{%- else -%}
[-] {{task.name}}
{%- endif -%}
{%- if task.has_subticket %} #{{task.subticket_id}}{% endif -%}
{{newline}}
{%- endfor -%}
Or if you wanted to list out all of the tasks & the total time in minute it took for each one to be completed you could use:
{% capture newline %}
{% endcapture %}
{%- for task in ticket.completed_tasks -%}
Task: {{task.name}} - Time to complete: {{task.time_to_completed_in_minutes}} minutes {{newline}} {{newline}}
{%- endfor -%}
Step 4. Hide your new Zendesk data fields.
To hide the 3 data fields that you've just created in order to stop anyone from manually altering them you can do this a couple of ways. You can either use the SweetHawk Hide ticket fields app which is free and super simple, Or you can use the SweetHawk Field Rules app, which gives you a huge amount of flexibility around what fields are hidden, mandatory, read-only and who can see them.
Now you've completed the above, you're all set to start building reports as you like in Zendesk Explore. We have a kb article here that walks through how to do this. Just remember it will take between 1 and 24 hours for the new fields to be created in Explore, and they will only show up if there is at least 1 ticket with data saved in the fields.
Comments
0 comments