Automation #6 - Prevent Re-opening of Closed Tickets

Automation #6 - Prevent Re-opening of Closed Tickets



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.

Typically when a customer submits a support ticket, it is assigned with a status to map its journey. Zoho Desk provides you with four default statuses: Open, On hold, Escalated, Closed; along with the option to create your own statutes which can then be mapped to these default ones.  
 
Once the solution has been provided to the customer and the ticket is resolved the ticket is marked as "Closed". But the status changes from "Closed" to "Open" if the customer replies to the same ticket. While this behaviour might be useful for some businesses who prefer to continue the same thread instead of reopening a new one, some might not want to do so. To ensure the ticket stays in the closed status and start a new thread for a customer reply, you can create a Workflow Rule and map it to a custom function script to achieve the desired results.

Prerequisite:

To ensure the Closed status is maintained even if a customer replies to a ticket, perform the following steps: 
1. Go to Setup, and under Customization, click Ticket Status, uncheck the "Fall-Back To Default" checkbox against "Closed" status.
2. OrgID, to get the OrgID, navigate to "Setup >> Developer Space >> API". Note down the OrgID

To create the workflow rule, perform the following steps:

1. Go to Setup, and under Automation, click Workflows.
2. On the left panel, under Workflows, click Rules > Create Rule.
In the Basic Information section, perform the following steps:
3. In the Module drop-down menu, select Tickets.
4. Enter a name and description for the rule.
5. 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.
6. Click Next.
In the Execute on section, perform the following steps:
7. Select the Customer Reply checkbox to execute this rule every time a customer responds to a ticket.  
8. Click Next.
9. In the Criteria section, set the criteria as "Status is Closed" and click "Next"
In the Actions section, perform the following steps:
10. Click the + icon under "Action" and select "New" next to Custom Functions
11Enter a name and description for the custom function.
12. In the script window, input the Custom Function you find below:
  1. numberOfHours = 48;
  2. orgId = "Paste Org Id here";
  3. //Please paste your OrgID
  4. TicketInfo = zoho.desk.getRecordById(orgId,"tickets",TicketID);
  5. lastModified = TicketInfo.get("closedTime").toTime("yyyy-MM-dd'T'HH:mm:ss");
  6. status = TicketInfo.get("status");
  7. hoursBetween = now.hoursBetween(lastModified).abs();
  8. if(hoursBetween >= numberOfHours)
  9. {
  10. threadResponse = zoho.desk.getRelatedRecords(orgId, "threads", "tickets", TicketID);
  11. if(threadResponse.get("data") != null)
  12. {
  13. latestThreadID = threadResponse.get("data").get(0).get("id");
  14. splitTicketResponse = zoho.desk.ticket.split(orgId, TicketID, latestThreadID);
  15. info "splitTicketResponse ::::" + splitTicketResponse;
  16. info "======================================================";
  17. NewTicketNumber = splitTicketResponse.get("ticketNumber");
  18. NewTicketID = splitTicketResponse.get("id");
  19. }
  20. }
  21. else
  22. {
  23. jsonString = {"status":"Open"};
  24. TicketResponse = zoho.desk.update(orgId, "tickets", TicketID, jsonString);
  25. info TicketResponse;
  26. }

NOTE:
Line 1 numberOfHours = 48, refers to the hours post which the new response received in a existing ticket should be split as new ticket. You can replace the number of hours based on your requirement.
Line 2 replace the orgId.

13. Click Edit Arguments
14. In the Name field type TicketID, and from the Value drop-down list select Ticket Id under Ticket Information
15. Click "Save" to save the custom function
16. Click "Save" again to save the workflow.

These steps would ensure that when a ticket is marked Closed, it stays in the Closed status, even if a customer replies after the mentioned hours. But also ensure that the new reply is added as a new ticket so you don't miss anything!

    • 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