This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk.
In Zoho Desk, Round Robin is a ticket assignment method that distributes and assigns incoming tickets equally among agents. It is designed to ensure that the ticket load of agents is always balanced. It achieves this goal by first assigning tickets to the agent with the least load.
However, in some cases, this focus towards balancing work load can inadvertently result in overloading an agent. For instance, let’s take a scenario wherein there are zero incoming tickets. The first ticket comes in and gets assigned to the first agent in the Round Robin queue. The agent responds swiftly and closes the ticket even before the next ticket comes in. Now, because the first agent in the queue has no tickets in their pipeline, the Round Robin method automatically assigns even the new incoming ticket to the first agent, instead of the next agent in the queue. If this keeps happening frequently, it would for sure overload individual agents.
You can overcome this challenge using this custom function, which we have created specially for small teams, where this issue could occur frequently.
Pre-requisite:
Edit your newly created Agent contact. For the values, collect and save all the agentIds in the Agent List fields. Please note the Agent List should be a comma separated values. Add the first agent in the Next Agent field.
- In the Contacts Layout, create two fields:
- Add a multi line field and name it as Agent List
- Add a single line field and name it as Next Agent
- Create a Contact Named Agent
- Edit your newly created Agent contact. For the values, collect and save all the agentIds in the Agent List fields. Please note the Agent List should be a comma separated values. Add the first agent in the Next Agent field.
To create the workflow rule, perform the following steps:
- Go to Setup, and under Automation, click Workflows.
- On the left panel, under Workflows, click Rules > Create Rule.
In the Basic Information section, perform the following steps: - In the Module drop-down menu, select Tickets.
- Enter a name and description for the rule.
- If you want to activate the rule right away, select the Active checkbox. Else, you can just create the rule now and activate it later on the Rules page.
Click Next.
In the Execute on section, perform the following steps:
- Select the Create checkbox to execute this rule every time a new ticket is created.
Click Next.
You can keep the Criteria section blank for this rule,
In the Actions section, perform the following steps:
- Click the + icon and select Custom Functions > New
- Click Edit Arguments
- In the Name field type TicketID and from the Value drop-down list select Ticket ID and click Done
Note: Enter the name of the connection as "deskoperation"
In the script window, all the below Custom Function - orgId = "paste org ID here";
- contactId = "paste contact ID here";
- contactInfo = zoho.desk.getRecordById(orgId, "contacts", contactId,"deskoperation");
- allAgents = contactInfo.getJSON("cf").getJSON("cf_agent_list").toList();
- nextAgent = contactInfo.getJSON("cf").getJSON("cf_next_agent").toLong();
- assignTicket = zoho.desk.update(orgId, "tickets", TicketID, {"assigneeId":allAgents.get(allAgents.indexOf(nextAgent))},"deskoperation");
- if (allAgents.indexOf(nextAgent).toLong() < allAgents.size().toLong() -1)
- {
- updateNextAgent = zoho.desk.update(orgId, "contacts", contactId, {"cf":{"cf_next_agent": allAgents.get(allAgents.indexOf(nextAgent)+1)}},"deskoperation");
- }
- else
- {
- updateNextAgent = zoho.desk.update(orgId, "contacts", contactId, {"cf":{"cf_next_agent": allAgents.get("0")}},"deskoperation");
- }
Note: The ORGID and AuthToken has to be replaced with your own IDs. You can get Auth token from Setup > developer space > api > browser mode and OrgID from Setup > Developer Space > API > OrgId
Follow this channel to get updates on our next post. Until then, happy automating!