Recipe: Recording and reporting on the approval granted date in Explore.

 

This article is for Zendesk approvals app Approve, which is our newest app for building approval processes.

If you're needing information on our older app Zendesk approvals app Approvals please see this section of our knowledge base.

This article explains how, using the SweetHawk Approve app, when the status of an approval is changed to granted, the date of that event is recorded in a custom date field of your choice.

That date field information will then automatically flow into Zendesk Explore where it can be used to slice up queries and report on when and how many tickets were approved. 

 

Stage 1: Recording the date.

Step 1: Create a custom date field. 

Step 2: Set the date field when approval is granted.

Step 3: Ensure the date field is hidden for all agents. 

 

Stage 2: Building a report.

Example report of how many tickets were marked as approved each month:

Zendesk_Explore.jpg

 

 


STAGE 1: Recording the date.


Step 1: Create the custom date field. 

To create a custom date field, first click on the cog on the left of the screen, go into Ticket Fields, and on the right click on Add field like this:

SweetHawk__-_Agent.jpg

Then give the field the name "Date approval was granted", select Date from the options and at the bottom right click on Save like this:

SweetHawk__-_Agent.jpg

 

Step 2: Set the date field when approval is granted.

Now on the left of the screen click into the Approve app, go to Settings and then under "Approval status change ticket update" click the + icon on the right. Search for the field called "Date approval was granted" and select it like this: 

Screenshot_22_12_21__12_20_pm.jpg

Now in the field place the following code: 

{% if request.status == 'granted' %} {{'now' | date: '%s' | date: '%Y-%m-%d'}} {% endif %}

It should look like this: 

SweetHawk__-_Agent.jpg

Step 3: Ensure the date field is hidden for all agents. 

There is a very easy way to ensure that agents are not able to manually set the date in this field. That is, to ensure this field is not added to any of your Zendesk forms. If the field does not exist on the forms, agents will not be able to update it. 

You may be wondering then, how could the field be updated by the app if it doesn't exist on the form? This is because of the way that this field will be updated. Even though it doesn't exist on the form, it still exists! ...and information can still be pushed into it via the API. This is exactly how the app updates fields based on the Settings in step 2 above.

 

Note: if you are on a Zendesk plan that does not have access to Zendesk forms, then instead of using this method, you will need to use our free Hide Ticket Fields app

 

 


STAGE 2: Building a report in Explore.


Before beginning stage 2 you may need to wait between 1-24 hours until the field that you've created above gets pushed over into Explore. It will also take some time for Approval date data to naturally build up so it may be worth waiting longer until that happens. 

 

Go to Explore and click into the Queries section like this: 

Zendesk_Explore.jpg

Now click to create a new query at the top right.

Zendesk_Explore-1.jpg

Now select Support, set the dataset to Tickets, choose the default data set and select New query like this:

Zendesk_Explore-2.jpg

 

At the top right of the screen click add next to Metrics click Add, search for Tickets, click Tickets and select Apply like this" 

Screenshot_16_12_21__12_12_pm.jpg

Now in the Columns section click on Add, search for the "Date approval granted" field and select Date approval granted - Month and click Apply like this:

Screenshot_22_12_21__12_41_pm.jpg

Now you will need to exclude all tickets that do not have an approval granted date set, you can do this by clicking back into the Date approval was granted item in Columns, then under Excluded check NULL and click Apply like this: 

 

Zendesk_Explore.jpg

You can then go about setting things like the visualization type as per your preference, or applying further columns to slice the information by. Once you're happy with the information in your report, be sure to give it a name and then Save it for use in any of your dashboards like this:

Zendesk_Explore.jpg

 


Was this article helpful?
0 out of 0 found this helpful

Comments

2 comments

  • A recipe to show approval request status in Explore will be nice too :) 

    0
  • Hi raphael thanks for the request. Yes an article like that is on our todo list. The general gist of how you could do that would be to have a custom dropdown field containing options like 'X Requested', 'X Approved', 'X Denied', 'X Timed out'. Then you would map the events: started, granted, denied and timed out in the 'Ticket updates' part of the Approval definition to the options in the dropdown field. Doing this means the dropdown field appears as an attribute in Explore to slice and dice your reports. If you have any clarifying questions on this (while the article hasn't yet been written), please shoot us through an email to support@sweethawk.com

    0

Please sign in to leave a comment.