Round robin ticket assignment
By Michael Stone of BetterCloud and Bill French of iPad CTO
Overview
We worked with Bill French of iPad CTO to develop this Zendesk Round Robin Ticket Assignment application. This application was made using Google Apps Script and is built entirely in Google Docs. You can run this script as long as you have an active Gmail or Google Apps account.
This script is run off of a simple spreadsheet (linked below) which is used to manage your support team and the tickets that will be assigned to them. Assignments are made based on tags. We recommend you use Triggers to have a tag automatically applied to each ticket as it is submitted.
CLICK HERE TO CREATE A ZENDESK ROUND ROBIN APP
Steps
After you download the Round Robin app, follow these steps.
Create a trigger
Create a Trigger based on your criteria to add a Tag when the ticket is created.
This app will assign your tickets out based on this tag. It is very important that this Tag matches the tag placed in the Notes field of your column headers.
Set up the apps script
On the spreadsheet, navigate to: Tools > Script Editor.
- Set the [Spreadsheet ID] value in Line 10 to the ID of your spreadsheet.
This can be found in the URL of your spreadsheet after ‘http://…...spreadsheet/ccc?key=’ and before the ‘&’
CommunityTip - Google spreadsheets have a new URL format. There isn't any ampersand (&) symbol in the Google Docs / now Google Drive URL. Instead, just grab the info after https://docs.google.com/spreadsheet/ccc?key= and before #gid=0 (see attached screenshot - I obscured my spreadsheet ID).
- Set the [subdomain] value in Line 23 to your Zendesk subdomain.
For example if your Zendesk domain is: subdomain.zendesk.com, the value here would be: subdomain.
- Set the [username] value in Line 24 to your Zendesk username.
For example: mike@bettercloud.com
- Set the [Zendesk API KEY] value in Line 25 to your current Zendesk API Key.
This can be found by clicking the Manage icon then selecting Channels > API.
Community Tip - Save the API setting! If you don't already have Token Access enabled in Manage > Channels > API, you need to check that box AND CLICK THE SAVE BUTTON. I checked the box, copied the API token and went on my merry way only to find out that nothing was happening... until I went back and double-checked everything and figured out that I hadn't clicked the save button on that settings page. Also note that Zendesk issues a new API token if and when you enable it for the second time.
Set up automatic updates
To automate the process of assigning tickets in a timely fashion, you must use a trigger in Google Docs to run the makeAssignment() function every five minutes or perhaps at intervals suitable to the flow of the tickets being received.
- Select the Tools | Script Editor... from the sheet, and then select Resources | Current project’s triggers
- Run: makeAssignments Events: Time-driven: minutes timer > Every minute
Sample use case
We currently have four different Forms that End-Users can submit tickets under: Question, Problem, Account Inquiry and Other. We have set-up a Trigger that applies the tags ‘form_question’, ‘form_problem’, ‘form_account’, and ‘form_other’ when a ticket is submitted. Any users with an ‘x’ next to their name will be assigned the next ticket that comes in with that tag (as long as they are next in the queue).
You can use this script with other tags as well, it does not need to be used with Forms in particular. However, these tags must be applied to the ticket once it is created in order for the script to run properly.
Community Revisions
11/29/17
Rob Baker was kind enough to share his version of the Zendesk Round Robin Script titled 'Zendesk Roulette'. Here is a list of the new features and a link to the updated script:
* Added Properties so that each function could be called independently | |
* Added a main function so script can be manually run | |
* Added search filter changes to limit results to only tags of interest and oldest tickets first | |
to avoid hitting script processing time limits | |
* Limited assignment to a maximum of 10 tickets per pass to avoid the entire queue from being assigned at once | |
* Fixed an issue where the last agent assigned would continue to be pushed tickets if there were no active agents | |
including the previously assigned agent | |
Variables that need to be populated prior to use | |
* [YourSheetID] | |
* [YourSubDomain] | |
* [YourUserName] | |
* [YourToken] | |
* [YourTags] https://github.com/grnhse/zdr/blob/master/zendeskMakeAssignments.gs |
-
Great tip Michael - thanks for sharing.
-
Does this process run even if the Google Docs is closed or do I need to keep the document open in order for this to work?
-
Same question as Melissa, does the Google Doc need to be open for this process to work ?
Zendesk - Any chance that ticket round robin assignment may become a standard feature ?
-
Hi Melissa/Mark,
The document does not need to be open in order for the script to run. Step 5 in this guide will run this script every minute in the background and ensure that your tickets are assigned.
Please let me know if you have any other questions.
Thanks!
-
Hi Michael,
Thanks for the tip!
I'm having a problem with this; the script seems to running even when the Active is set to "No".
It even ran with all agents set to "No"
Thanks!
Christopher
-
Hi all,
Anyone else here experiencing time lags when running the minutes trigger. This started after Zendesk's latest updates on Sunday morning, 6/1/2014
Christopher
-
I am receiving an SSL error:
SSL Error https://{domain omitted}.zendesk.<?>/api/v2/search.json?query=type:ticket%20status:new%20assignee:none (line 160, file "zendeskMakeAssignments")
The API query looks fine so I'm not sure what's going wrong.
-
Hi all,
I would be really interested in using this application as follow:
All tickets coming from a specific channel are assigned to 4 agents.
Could someone help me understand how to create the proper trigger to achieve this using the Round Robin application?
Thanks a lot in advance!
-
@Christopher Louie -- are you still experiencing issues with the Active field? Feel free to share your sheet with me and I'll take a look (mike@bettercloud.com)
@Gareth -- Interesting, have you made any changes to the original code?
@Elisa -- In order to achieve this you would create a Trigger that would automatically assign a tag to tickets open via that specific channel. Once you have done this, add the specific tag to the column header so the tickets can be assigned properly.
Thanks!
-
Hi Michael,
Thanks a lot for your help, this is really appreciated (especially as I am struggling a bit with the process).
The tickets I want to assign all come from a mail channel, say GMAIL.
Every single ticket submitted through this channel is automatically assigned to the view UNASSIGNED GMAIL TICKETS with the tag "gmail_elisa".
Now, I want all these tickets to be assigned evenly among 4 agents (all 4 agents are constantly active).
I have created my Zendesk Round-Robin app as shown in the screenshot.
I have then created a trigger to add the tag "Mail_Tag" to all Tickets coming from my GMAIL channel as below:
Meet ALL of the following:
Ticket is created
Ticket channel is GMAIL
Is this in anyway correct?
I really, really do appreciate your advice with this and I thank you in advance for your precious help.
Perform these actions:
Ticket: Add Tags Mail_Tag
-
@Michael: No, I have only configured the required sections.
-
@Michael Stone - Great, I've just shared the sheet to you with comments privileges. Let me know if you see anything.
Thanks! Christopher
-
@Gareth @Christopher @Elisa I'd love to schedule a call with each of you to discuss these problems. Feel free to shoot me an email at mike@bettercloud.com and we can schedule some time to chat.
Thanks!
-
Hi,
I'm trying to set up the script but I'm facing some authentication issue.
the exact error message is : Request failed for https://smartadserver.zendesk.com/api/v2/search.json?query=status:new%20assignee:none returned code 401. Truncated server response: {"error":"Couldn't authenticate you"} (use muteHttpExceptions option to examine full response) (line 154, file "zendeskMakeAssignments")
I've followed each step of the documentation and I can't figured where I got something wrong.
I've posted a message here : https://support.zendesk.com/entries/41277273 but no solutions came up from here.
Am I the only one facing this kind of problem?
Thx
Edouard
-
please, just ignore my previous message, I got it right :)
Ed
-
For any other n00bs out there, here are some tips where I initially screwed this up but eventually got it working:
Tip 1 (related to step 4, bullet 2) - Google spreadsheets have a new URL format
There isn't any ampersand (&) symbol in the Google Docs / now Google Drive URL. Instead, just grab the info after https://docs.google.com/spreadsheet/ccc?key= and before #gid=0. (see attached screenshot - I obscured my spreadsheet ID)
Tip 2 (related to step 4, bullet 5) - Save the API setting
If you don't already have Token Access enabled in Manage > Channels > API, you need to check that box AND CLICK THE SAVE BUTTON. I checked the box, copied the API token and went on my merry way only to find out that nothing was happening... until I went back and double-checked everything and figured out that I hadn't clicked the save button on that settings page. Also note that Zendesk issues a new API token if and when you enable it for the second time.
Hope this saves someone a headache. Happy Zendesking!
-
Justin, thanks so much for sharing your tips! I will add these to the article--I don't think Michael will object. I'm sure this info will save some headaches.
-
@Michael Stone: Thanks again! It's working perfectly now.
-
Hey all,
@Justin @Jennifer -- thanks for the additional tips! Please feel free to add these to the article, no objections on my end :)
@Ed -- Happy you were able to sort this out! If anything else pops up feel free to shoot me an email -- mike@bettercloud.com
@Gareth -- Awesome! It was great speaking with you. Happy I was able to help.
-
@Christopher - I ran into the same issue you did, where we set every agent to "No" but tickets were still getting assigned. What happens, just so everyone knows, is that every New ticket with the specified tag will get assigned to whichever agent has the "x" in the queue column of the Google Docs/Drive spreadsheet. Not a great time for that agent...
I emailed Michael for a fix and it was so simple I had to palm my forehead-- just remove the "x" from the queue column. Knowing this, we can now effectively turn off the round robin system altogether if needed from time to time.
Thanks for a great app Michael! You made me a rockstar with my boss today :)
-
@Justin, interesting. That hasn't been our experience. I just repro'd the problem again. With all agents toggled to "No" the agent at the top of the queue repeatedly gets assigned tickets. For now, we make sure at least one agent is set to "Yes". I wonder what's different about your setup. For now, it works well enough and it certainly is an enhancement (we all wish Zendesk would incorporate).
-
I can vouch for this document's effectiveness, so thanks, Michael. However, I did notice that after about a month of running it, the assignment log had grown so large that it started pushing on the maximum size of a Google doc. I made a new copy to start fresh, but it may make sense to have more options to prune the assignment log after X days have passed or after it gets to be a certain size.
-
Just a heads up-- the Round Robin won't work if you disable the setting for "Enable tags on tickets".
I wanted to (and did) disable tags on tickets when I realized it would hide the tags from our agents and free up that screen real estate. I did this only after doing some testing and seeing that doing this actually doesn't stop ZD from tagging the tickets, it just stops presenting those tags to the agents.
Unfortunately, even though Zendesk continues to tag your tickets in the background, apparently the tags need to be in the foreground (for lack of a better term) in order for the Round Robin to function.
See screenshot for location of this setting. ....and yes, I can screw up almost anything :)
PS- Re-enabling this setting in ZD, waiting 10 minutes, and re-running the round robin processed the backlog of unassigned tickets.
-
Request failed for https://arcserve.zendesk.com/api/v2/search.json?query=type:ticket%20status:new%20assignee:none returned code 401. Truncated server response: {"error":"Couldn't authenticate you"} (use muteHttpExceptions option to examine full response) (line 160, file "zendeskMakeAssignments")
getting the above error
-
and after clicking on details
-
error screenshot attached
-
Looks like changes to Zendesk's platform makes this workaround unusable. Looking for insight to resolve this. Christopher
Here's the output of running each process:
testGetFormColumn
Method Range.getComment is deprecated.Collapse*File: *zendeskMakeAssignments *Line: *313The method has been marked as deprecated which means that the feature should be avoided and may be removed in the future. Consider using an alternative solution.
with a similar message after running makeAssignments
Cannot find method getRange(number,number,number,(class)). (line 285, file "zendeskMakeAssignments")
seekOpenTickets
Request failed for https://undefined.zendesk.com/api/v2/search.json?query=type:ticket%20status:new%20assignee:none returned code 404. Truncated server response: { "error": { "title": "No help desk at undefined.zendesk.com", "message": "There is no help desk configured at this address. This means t... (use muteHttpExceptions option to examine full response) (line 159, file "zendeskMakeAssignments")
a similar message for getOpenTickets
Request failed for https://undefined.zendesk.com/api/v2/tickets/recent.json returned code 404. Truncated server response: { "error": { "title": "No help desk at undefined.zendesk.com", "message": "There is no help desk configured at this address. This means t... (use muteHttpExceptions option to examine full response) (line 137, file "zendeskMakeAssignments"
-
Hi all,
@Ravi, Sorry your having trouble with this! Unfortunately, I am unable to view the screenshots you have provided. Would you mind sharing them with me here: mike@bettercloud.com
@Christopher, Interesting, the script is still working on our end. Would you mind sharing your script with me so I can take a look at it? Please share with: mike@bettercloud.com
Thanks!
Mike
-
I tried too many times but dropped the ball now. You can ignore my request on this.
-
@Michael will do
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
111 Kommentare