'Tis the holiday season—a time when work often takes a brief pause.
The holiday spirit is in full swing at Zylker Techfix too, with employees taking some well-deserved time off. During this period, ticket owners are frequently offline at work.
Amid the holiday hustle and bustle, customers continued responding to tickets. Unfortunately, tickets assigned to agents on leave went unnoticed, as they were not listed under unassigned requests.
Zylker Techfix needed a solution to ensure such tickets were reassigned to "Unassigned," preventing any customer requests from being overlooked. This is where a custom function came to the rescue, just in time!
Here’s how you can use this custom function to move tickets automatically to "Unassigned" when the ticket owner is offline and a customer replies. Follow these steps to implement the custom function within a workflow rule.
Prerequisites
1. Create a connection
1.1 Go to Setup(S) and choose Connections under Developer Space.
1.2 Click Create Connection.
1.3 Select Zoho OAuth under Default Connection.
1.4 Set the connection name as deskconnection.
1.5 Under Scope, choose the below scope values:
Desk.settings.READ
Desk.basic.READ
Desk.tickets.UPDATE
Desk.tickets.READ
1.6 Click Create and Connect.
1.7 Click Connect and click Accept.
Connection is created successfully.
Create a Workflow Rule
1. Go to Setup, choose Workflows under Automation.
2. Under Workflows, click Rules >> Create Rule.
In the Basic Information section,
3. Select Tickets from the drop-down menu under Module.
4. Enter a Rule Name and Description for the rule.
5. If you want to activate the rule right away, select the Active checkbox. Else, create the rule and activate it later.
6. Click Next.
In the Execute on section, follow these steps:
7. Select Customer Reply.
8. Click Next.
9. In the Criteria section, select Ticket Owner is not empty. click Next.
10. In the Actions section, click the + icon and select New next to Custom Functions.
12. Enter a Name and Description for the custom function.
13. In the script window, insert the Custom Function given below:
// ----<<<< User Inputs >>>>----
// --- Replace ".com" with appropriate domain extension based on customer's location/DC ---
for each agentInfo in onlineAgentsInfo.get("data")
{
onlineAgentsId.add(agentInfo.get("agentId"));
}
}
logs.insert("onlineAgentsId":onlineAgentsId);
if (!onlineAgentsId.contains(assigneeId.toString()))
{
ticketUpdate = invokeUrl
[
url : deskURL + "/api/v1/tickets/" + ticketId
type : PATCH
parameters : {"assigneeId":""}+""
connection : "deskconnection"
];
logs.insert("ticketUpdate":ticketUpdate);
}
}
catch (errorInfo)
{
logs.insert("errorInfo":errorInfo);
}
info "logs: \n" + logs;
if(logs.containKey("errorInfo"))
{
throws "Error happen in the CF execution";
}
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 5, add the departmentId of the department where you want to configure this custom function.
How to fetch the DepartmentId?
To find the departmentId, navigate to Setup (S) >> Organization >> Departments. Select the department where you want to configure the custom function. Copy the numerical ID at the end of the URL from the address bar.
14. Click Edit Arguments and include the argument mapping as below:
14.1 In the Name field, type ticketId and select Ticket Id under the Tickets Section.
15. Click Done.
16. Click Save to save the custom function.
17. Click Save again to save the workflow.
Our Community Series is here to provide practical tips and solutions. If you have any questions or suggestions, feel free to reach out to us at support@zohodesk.com—we’d love to hear from you!
Wishing you a joyful and productive holiday season.
Those are the essential changes. If you’ve ensured the arguments are mapped, the script should work as expected. If you continue to face issues, please email support@zohodesk.com with the following details, we can debug on this further.
1. Save and execute the script, then share the output.
2. Sample ticket URL where this was tested.
Regards,
Shivani | Zoho Desk
Reply to Lydia | Zoho Desk A
/* */
12
Insert
Plain text
Rich Text
Add Comment
(Up to 20 MB )
Stats
2 replies
181 views
Follow
Subscribe to receive notifications from this topic.
Hi@Amelia AM Amelia Follow ,