Welcome to Portal

?Unknown\pull-down

Welcome to Zoho Cares

Bienvenido a Soporte de Zoho

Search our knowledge base, ask the community or submit a request.


Hello Everyone!
Ever found yourself juggling multiple service requests that seem like pieces of a larger puzzle? Managing interconnected tickets can be challenging, especially when updates on child tickets need to be tracked. That’s where our custom function steps in!
This week, we introduce a solution to notify the parent ticket owner whenever changes occur in child tickets. The Parent-Child Ticketing feature in Zoho Desk allows you to link related tickets for better tracking and collaboration. While different agents managed child issues, the parent ticket owner needed timely updates to stay connected with customers.

Here’s the custom function to address this – follow the steps below to configure it!
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.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 Field Update and select Status from the drop-down menu.  
8. Click Next.
 
9. In the Criteria section, add criteria if required. 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. // ----<<<< User Inputs >>>>----
  2. // --- Replace ".com" with appropriate domain extension based on your DC --- 
  3. deskURL = "https://desk.zoho.com";
  4. //Replace with your preferred Email Notification Subject
  5. subject = "Child ticket status update";
  6. //Replace with your preferred Email content for the ticket owner
  7. content = "The Child ticket associated to your parent ticket has a status update";
  8. // ----<<<< Initial Configs >>>>----
  9. logs = Map();
  10. parentTicketId = null;
  11. logs.insert("ticketId":ticketId);
  12. //---------------------------
  13. try 
  14. {
  15. // ---- start your logic from here ----
  16. ticketInfo = invokeurl
  17. [
  18.   url :deskURL + "/api/v1/tickets/" + ticketId
  19.   type :GET
  20.   headers:{"featureFlags":"lookUp"}
  21.   connection:"deskconnection"
  22. ];
  23. logs.insert("ticketInfo":ticketInfo);
  24. if(ticketInfo != null && ticketInfo != "" && ticketInfo.get("relationshipType") == "Child")
  25. {
  26.   parentTicketInfo = ticketInfo.get("parentTicket");
  27.   if(parentTicketInfo != null && parentTicketInfo != "" && parentTicketInfo.containsKey("id"))
  28.   {
  29.   parentTicketId = parentTicketInfo.get("id");
  30.   }
  31. }
  32. if(parentTicketId != null)
  33. {
  34.   parentTicketInfo = invokeurl
  35.   [
  36.   url :deskURL + "/api/v1/tickets/" + parentTicketId + "?include=assignee"
  37.   type :GET
  38.   connection:"deskconnection"
  39.   ];
  40.   logs.insert("parentTicketInfo":parentTicketInfo);
  41.   parentTicketAssigneeInfo = parentTicketInfo.get("assignee");
  42.   if(parentTicketAssigneeInfo != null && parentTicketAssigneeInfo != "" && parentTicketAssigneeInfo.containsKey("email"))
  43.   {
  44.   parentTicketOwnerEmail = parentTicketAssigneeInfo.get("email");
  45.   sendmail
  46.   [
  47.     from :zoho.adminuserid
  48.     to :parentTicketOwnerEmail
  49.     subject :subject
  50.     message :content
  51.   ]
  52.   }
  53. }
  54. }
  55. catch (errorInfo)
  56. {
  57. logs.insert("errorInfo":errorInfo);
  58. }
  59. info "logs: \n" + logs;
  60. if(logs.containKey("errorInfo"))
  61. {
  62. throws "Error happen in the CF execution";
  63. }
Notes
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 5 and 7, insert the Email subject and Email content that has to be sent to the Ticket Owner
13. Click Edit Arguments and include the argument mapping as below: 
  13.1 In the Name field, type ticketId and select Ticket Id under the Tickets Section.
14. Click Done.  
15. Click Save to save the custom function.
16. Click Save again to save the workflow.
Info
If you would like to add a comment to the Parent ticket, please email us at support@zohodesk.com
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!
Until next time,
Regards,
Lydia | Zoho Desk 


Reply
Reply to Lydia | Zoho Desk A
/* */
  • 12
  • Insert
  • Plain text
Add Comment
(Up to 20 MB )