- Go to Setup, and under Automation, click Workflows.
- On the left panel, under Workflows, click Rules > Create Rule,
In the Basic Information section, carry out the following steps: - In the Module drop-down menu, select Tickets.
- Enter a name and description for the rule.
- 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.
- Click Next.
In the Execute on section, perform the following steps: - Select the Create checkbox to execute this rule every time a new ticket is created.
- In the Criteria section, perform the following steps:
If you want to delete tickets based on the content in the Subject field, add this criteria:
Subject contains <keywords separated by commas.
If you want to delete tickets based on the content in the Subject field and the email ID of the contact, add this criteria:
Subject contains <keywords separated by commas>
AND/OR
Email contains <email ids separated by commas>
If you want to delete all tickets except the ones that have a specific content in the Subject field and/or were sent by a particular sender, add this criteria:
Subject doesn't contain <keywords separated by commas>
AND
Email doesn't contain <email ids separated by commas>
- Click "Next".
- In the Actions section, carry out the following steps:
- Click the + icon under "Action" and select "New" next to Custom Functions
- Enter a name and description for the custom function. Choose Tickets under Module.
- Under Argument Mapping, give a desired Method Name. Map the arguments as below:
16.1 In the Argument Name field type ticketID, and from the Value drop-down list select Ticket Id under Tickets Section. In the script window, input the Custom Function you find below:
- deskDomain = "https://desk.zoho.com";
- //Replace your zoho desk URL accordingly
- jsonString = {"ticketIds":{ticketID}};
- deleteTicket = invokeurl
- [
- url :deskDomain + "/api/v1/tickets/moveToTrash"
- type :POST
- parameters:jsonString.toString()
- connection: "autodeletetickets"
- ];
Click "Save" to save the custom function
-
Click "Save" again to save the workflow.