Automation#17: Auto-Create Tasks in Zoho Projects Upon Ticket Creation in Zoho Desk

Automation#17: Auto-Create Tasks in Zoho Projects Upon Ticket Creation in Zoho Desk



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:
  1. //Enter your PortalId
  2. PortalId = "********dotcom";
  3. // Enter you Project Id
  4. ProjectId = 23***********93;
  5. //Enter Zoho projects domain based on DC
  6. projectsURL = "https://projects.zoho.in";
  7. //Code starts here;
  8. if(TicketID != null)
  9. {
  10.  TaskName = TicketSubject + " " + TicketID;
  11.  CreateTaskParam = Map();
  12.  CreateTaskParam.put("name",TaskName);
  13.  CreateTask = invokeurl
  14.  [
  15.   url :projectsURL + "/restapi/portal/" + PortalId + "/projects/" + ProjectId + "/tasks/"
  16.   type :POST
  17.   parameters:CreateTaskParam
  18.   detailed:true
  19.   connection:"projectconnection"
  20.  ];
  21.  info CreateTask;
  22. }
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!



      • Sticky Posts

      • Zoho Desk Virtual Meetup: US Central, October 5 - 7, 2021

        After the interactive Virtual Meetups in the other regions, we are starting with the US Central and Midwest regions from October 5 to October 7, 2021. The dates for other regions will be announced soon.  At this event, we will explore the topics which
      • Register for Zoho Desk Beta Community

        With the start of the year, we have decided to take a small step in making the life of our customers a little easier. We now have easy access to all our upcoming features and a faster way to request for beta access. We open betas for some of our features
      • Ask the Experts 10: A 5-hour online Q&A on Zoho Desk Best Practices

        Welcome to Zoho Desk's Ask the Experts session! This is a monthly discussion on our  forums; wherein a panel of experts will take on questions  specific to topics related to Zoho Desk. The panel will be available for a 5-hour period and will answer any questions posted here.   Let's begin the year learning some best practices from our experts. In this month's ATE we are opening the floor to questions on how to use Zoho Desk the best way.  If you have a business use case but not sure if Workflow is
      • Share your Zoho Desk story with us!

        Tell us how you use Zoho Desk for your business and inspire others with your story. Be it a simple workflow rule that helps you navigate complex processes or a macro that saves your team a lot of time; share it here and help the community learn and grow with shared knowledge. 
      • Ask the Experts 7: A 5-hour online Q&A on Telephony and Call Module

        Welcome to Ask the Experts session! This is a monthly discussion in forums; each session, a panel of experts will take questions on specific topics related to Zoho Desk. The panel will be available for a 5-hour period and answer any questions posted here. In this month's Ask the Experts, we will take questions on everything related to Telephony and the Call Module in Zoho Desk. We will discuss the following aspects:  Integration with different Telephony vendors Routing calls to agents Converting