Hello Everyone,
This edition delivers the solution to automatically create a task in Zoho Projects when a ticket is created in Zoho Desk.
Zylker Resorts uses Zoho Desk for bookings and handling guest requests. Zylker resorts outsources cab bookings to Zoot cabs. Zylker resorts has a specific department for Cab services in Zoho Desk. Tickets sent to this department are created as tasks under projects in Zoho Projects to handle cab services efficiently. To process the queries efficiently, Zylker Resorts sought to automate this task-creation process.
Let's dive in to see how.
Prerequisites
1. Create a connection
1.1 Go to Setup and choose Connections under Developer Space.
1.2 Click Create Connection.
1.3 Select Zoho OAuth under Default Connection.
1.4 Give the connection name as projectconnection.
1.5 Under Scope, choose the below scope values:
ZohoProjects.portals.READ
ZohoProjects.search.READ
ZohoProjects.tasks.CREATE
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 Create checkbox to execute this rule every time a new ticket is created.
8. Click Next.
9. Leave the Criteria blank and click Next.
10. In the Actions section, click the + icon and select New next to Custom Functions.
11. Enter a Name and Description for the custom function.
12. In the script window, insert the Custom Function given below:
//Enter your PortalId
PortalId = "********dotcom";
// Enter you Project Id
ProjectId = 23***********93;
//Enter Zoho projects domain based on DC
//Code starts here;
if(TicketID != null)
{
TaskName = TicketSubject + " " + TicketID;
CreateTaskParam = Map();
CreateTaskParam.put("name",TaskName);
CreateTask = invokeurl
[
url :projectsURL + "/restapi/portal/" + PortalId + "/projects/" + ProjectId + "/tasks/"
type :POST
parameters:CreateTaskParam
detailed:true
connection:"projectconnection"
];
info CreateTask;
}
Note: In line 2 and line 4, enter your PortalId and ProjectId from your Zoho Projects portal.
In line 6, enter your Zoho Projects URL with the domain based on your DC.
To access PortalId and ProjectId, go to Zoho Projects. Choose the project folder you have created under Recent Projects on the left panel, then click on the Dashboard tab. The URL in the address bar contains your PortalId and ProjectId.
13. Click Edit Arguments and include the argument mapping as below:
13.1.In the Name field type TicketId, and from the Value drop-down list select TicketId under Ticket Sections.
13.2.In the Name field type TicketSubject, and from the Value drop-down list select Subject under Ticket Sections.
14. Click Save to save the custom function
15. Click Save again to save the workflow.
Implementation
When a ticket is created in Zoho Desk, a task is generated under the specific project in Zoho Projects.
We hope this solution boosts productivity. Catch you next week with another custom function to enhance your experience!