Automation#20 : Auto-Add Ticket Tags based on Keywords

Automation#20 : Auto-Add Ticket Tags based on Keywords



Hello Everyone!
Welcome to unveiling custom functions on our Community series. This week's post lets you add tags to your tickets automatically based on the keywords in the ticket subject and the ticket thread.   
Discover how this custom function helps Zylker Techfix, a top gadget service company. Zylker Techfix services many different electronic devices every day, often facing tight deadlines. To make their work easier, they tag tickets based on the content of the email subject or thread for each gadget. This tagging system helps them prioritize cases, allowing Zylker Techfix to maintain a steady pace and provide quick solutions. As a result, their engineers deliver excellent work with less stress, ensuring high customer satisfaction.
Now, this custom function is yours to implement. Follow the steps below to configure it within the workflow rule.  

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 Set the connection name as deskconnection.
      1.5 Under Scope, choose the below scope values:
             Desk.tickets.Create
             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 Create and Customer Reply.  
8. Click Next.
9. Leave the Criteria section 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. //replace desk domain based on your DC
  2. deskDomain = "desk.zoho.com";
  3. //add the required keywords for which tags have to be added
  4. keywordsList = List();
  5. keywordsList.add("********");
  6. ticketTags = list();
  7. //Enter the Tags to add to the tickets having the above keywords
  8. ticketTags.add("******");
  9. //-------------------------------------------
  10. doesThreadContainRequiredKeywords = false;
  11. logs = Map();
  12. latestThreadData = invokeurl
  13. [
  14. url :"https://" + deskDomain + "/api/v1/tickets/" + ticketId + "/latestThread?include=plainText"
  15. type :GET
  16. connection:"deskconnection"
  17. ];
  18. threadContent = latestThreadData.get("plainText");
  19. logs.put("threadContent",threadContent);
  20. newContent = threadContent;
  21. for each  currKeyword in keywordsList
  22. {
  23. pattern = "(?i).*\b" + currKeyword + "\b.*$";
  24. if(newContent.matches(pattern) || subject.matches(pattern))
  25. {
  26. doesThreadContainRequiredKeywords = true;
  27. break;
  28. }
  29. }
  30. logs.put("doesThreadContainRequiredKeywords",doesThreadContainRequiredKeywords);
  31. if(doesThreadContainRequiredKeywords)
  32. {
  33. //associate required tag
  34. ticketTagParams = {"tags":ticketTags};
  35. associateTag = invokeurl
  36. [
  37. url :"https://" + deskDomain + "/api/v1/tickets/" + ticketId + "/associateTag"
  38. type :POST
  39. parameters:ticketTagParams.toString()
  40. connection:"deskconnection"
  41. ];
  42. }
  43. logs.put("associateTag",associateTag);
  44. info logs;
Notes
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 4, Enter the keywords (within " ") that has to be tracked from the ticket subject and ticket thread. 
c. In Line 8, Enter the tags names (within " ") to be added to the tickets. 
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 Ticket Id under the Tickets Sections.
     13.2 In the Name field, type subject, and from the Value drop-down list, select Subject  under the  Tickets Sections.       
14. Click Save to save the custom function.
15. Click Save again to save the workflow.
 
We hope this custom function helps you sort tickets by automatically associating ticket tags. If you would like to add multiple keywords to a single  tag, or other such combinations, please mail to support@zohodesk.com with your use case.

Until next week,
Regards,
Lydia Kiruba | Zoho Desk


    Access your files securely from anywhere


            Zoho Developer Community




                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day



                                          Zoho Marketing Automation
                                                  • 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
                                                  • 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. 
                                                  • Zoho Desk Community Meetups 2019 - Canada

                                                    Hey there!  ​ Are you making the best use of Zoho Desk? Do you think meeting and learning from other Zoho users in your city would help? If yes, then Zoho User Group Meetups is the right place for you! We're happy to announce our first Zoho Desk User Group meetups in Toronto, Montreal, Quebec City, Calgary, and Vancouver. These meetups are a great place to meet local Zoho users, Zoho Desk product experts and partners, all under one roof.    Join us as we discuss some key Zoho Desk features and share
                                                  • Tip #1: Learn to pick the right channels

                                                    Mail, live chat, telephony, social media, web forms—there are so many support channels out there. Trying to pick the right channels to offer your customers can get pretty confusing. Emails are most useful when the customer wants to put things on record. However, escalated or complicated issues should not be resolved over email because it's slow and impersonal.  When you need immediate responses, live chat is more suitable. It's also quick and convenient, so it's the go-to channel for small issues. 


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Whats App Automation

                                                                                                    It would be nice to be able to send out an automated whats app message template on moving stages or creation of a ticket (same as you can do for automated emails). Currently only automated emails can be sent. Also, if whats app could be used more effectively
                                                                                                  • proceed with ssl certificate to use my domain

                                                                                                    hi there i have completed the steps of creating and editing CNAME i want to use my domain.
                                                                                                  • Report inaccuracies

                                                                                                    I just generated an Expense by Category report in Zoho Books, expecting to get the expenses as reported in the Profit & Loss statement. No so! Specific expense categories that I had added in the chart of accounts were not included in the report, and some Cost of Goods Sold categories that should not have appeared were included. The Profit & Loss statement appears to be correctly reflecting all expenses, and the Expense by Category report is not. it is all over the place! From what I can tell, the
                                                                                                  • Initiate data import using Deluge script

                                                                                                    Is it possible to open the screen to begin the importing of new records using Deluge? So for example, my users would click a button on a form that starts a workflow action. This action would then open the screen to "Import Data for Current User Projects".
                                                                                                  • Default value from global set not working if leads comes Whatsapp

                                                                                                    I have field called 'Marketer' and I have set default value from global set like this if it is created manually by pressing 'Create Lead' button it works without problem, but the leads created automatically from Whatsapp (Business Messaging) the 'Marketer'
                                                                                                  • Function deleted after releasing connection in Kiosk

                                                                                                    Hi Everyone I create a Function (Automation) and link it in a Kiosk Workflow. Later, I decide not to use this function from Kios anymore, so I delete the entry in the Kiosk Workflow and publish the new Version. Problem 1: The Function remains linked until
                                                                                                  • Assistance with Survey Consent and Anonymization

                                                                                                    Hello, I am conducting a survey that requires both the minor’s consent and their parent’s consent prior to participation. As part of the consent process, I am required to collect the names of both the participant and their parent. I want to ensure that
                                                                                                  • Execution failure when fetching a Name field from another app

                                                                                                    In creator I have one app [Employee Directory] with a form [Employees]. One of the fields is a name field called [Name]. Here is a sample that works, if executed from the Employees app: test_Employee = Employees[Name.first_name == "Alex"]; info test_Employee.Name;
                                                                                                  • Countries and Towns - Lookup Multi Select

                                                                                                    Hi, Sorry I'm new with Zoho Creator and Deluge. ---------------------------- Form A = Countries Form B = Countries and Towns (with relation) in a Form C, i have a lookup field "Country" and after user input, i would like to auto populate the lookup multi
                                                                                                  • Deluge Script In CRM To Deal With More Than 200 Records

                                                                                                    Hi, I have a Deluge script, which works perfectly. We have a custom field in the Campaigns module called Total_Raised which looks at the Donation_Amount field in the custom module, Donations. The idea is to sum up the total of all donation amounts. However,
                                                                                                  • Software Integration

                                                                                                    Good day, I trust this message finds you well. I would like to find out how I can integrate Zoho Expense, Zoho inventory, email and collaboration, Human Resources and marketing onto our current plan with Zoho Books.
                                                                                                  • Zoho Survey - Respondent User Portal - RealTime & Response Access

                                                                                                    Hello everyone, I have two questions which I would appreciate your guidence on. 1. I have written to Zoho and they tell me no REAL TIME API access is available against completed surveys. From what I gather the only way to get these in real time is to
                                                                                                  • Zoho Sheet View

                                                                                                    Hello, Is there a way to either customize the columns that appear in Zoho Sheet View, or else show all columns?
                                                                                                  • Email alias to create task in a specific task list

                                                                                                    How do you create a task by emailing the email alias to a specific task list? I just tested this, and it just created the task in a 'General' task list - 'General' did not exist before so it has created this. A project might have multiple task lists and
                                                                                                  • Mapping a custom picklist to another picklist when creating a connected record with a workflow

                                                                                                    Hi, I have some workflows that move records between pipelines, the issue is that when setting up the workflow that creates the connected record, there is no option to map the value from a picklist in one pipeline to another. Please watch: https://www.loom.com/share/4e5fa969b21043748414154c036cdd47?sid=dca0fd16-73f2-4fe6-a9d3-7a4c0c40c2e6
                                                                                                  • Automatic Portal invite

                                                                                                    We have numerous customers we move through a blueprint in deals, when they get to a certain point we need to give them portal access, how can this be done through deluge or a workflow?
                                                                                                  • Search bar in portals

                                                                                                    Is there a way to add a search bar in portals for finding Contacts or Deals in the list?
                                                                                                  • Announcing Multi-language Support in Zoho FSM

                                                                                                    Zoho FSM now speaks your language. The much-awaited multi-language support is now available in Zoho FSM. The following languages are supported in Zoho FSM: Dutch (Nederlands) English - United Kingdom English - United States French (français) French -
                                                                                                  • Workdrive Oauth2 Token Isn't Refreshing

                                                                                                    I have set up oauth for a bunch of zoho apis and have never had a problem with oauth. With workdrive i am using the exact same template i usually use for the other zoho apps and it is not working. All requests will work for the first hour then stops so
                                                                                                  • Approval Processes Issue

                                                                                                    Hello, I have a significant issue that could potentially cause serious problems for our company. We have developed a new module that we use as a payment request module. In short, payment requests are made through this module and are approved by different
                                                                                                  • Does Zoho Sheet "Save as PDF" support Thai font?

                                                                                                    Hi I want to download Zoho sheet as PDF Document. In the preview it looking good but when I dowload it the font is look different. I use "Cordia New" but the result look like it swtich to "calibri". I try to use "Print" then select printing destination
                                                                                                  • how to create view in leads module to that will show all leads + converted leads?

                                                                                                    is it possible to make custom view that combine all leads + converted leads? how to do that
                                                                                                  • Global Subforms

                                                                                                    Hey 👋🏼 We have a few subforms to calculate detailed offers for customers of car dealerships. These subforms are used in different modules and we need to create snapshots of them in different cases for documentation reasons. For example, an approved
                                                                                                  • Guidance on Making Zoho Desk Connections Available for All Data Centers

                                                                                                    Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
                                                                                                  • Cannot Send Email to a Gmail Account

                                                                                                    Hello, I have a zoho-hosted email account, alex@chirochannelnetwork.com that has trouble sending to gmail accounts.  But not all gmail accounts, only some of them. I've tried to figure this out with clients, and they don't appear to be going into their
                                                                                                  • Associate Potential with Purchase Order

                                                                                                    Dear Zoho Team I'm looking at associating a Potential with the various Purchase Orders that are issued to Vendors for that specific Potential.  This would be of tremendous use at a later stage.  Is this possible? I have tried looking at mapping dependency fields, but couldn't find a solution.  Please advise.
                                                                                                  • Issue with Zoho Books /Zoho Inventory Support Team

                                                                                                    Oh my goss! This ticket just got closed without a solution/response?! (attached screenshot) That is so pathetic. I thought I could keep impartially all tickets tracked in your help website. Do I need to track issues raised to zoho support team in a separate
                                                                                                  • PRICE INCLUSIVE OR EXCLUSIVE IN ITEM MASTER CHECK BOX

                                                                                                    please provide checkbox or tick box to specify price mentioned in item master is inclusive or exclusive of taxes for better information. The feature is available in odoo and its very helpful.
                                                                                                  • Using Snippets in Comments

                                                                                                    One of our Agents asked about using snippets in comments. We don't see this as an option at this time, only in reply mode. Is there a way to enable this?
                                                                                                  • Images uploaded onto text notes through the mobile app won't render

                                                                                                    When uploading am image onto a text note, exiting the note and going back in, the image is gone and shows an error icon in its place, and also won't display directly on other devices, including on the desktop version. Uploading the same image on the same
                                                                                                  • Zoho Mail - Import Event from the main page (not options)

                                                                                                    Hello, If you need to import an event or invitation in Zoho Calendar, you need to go in the options/parameters to do the import. We would suggest to have a "import" button and pop-up on the main calendar page. It would avoid to go in the options to do
                                                                                                  • Zoho Books - Organize view in sections

                                                                                                    Hello, Is it possible to organize the basic or custom fields in Zoho Books (estimates, invoices...) views ? Did not find a way to do it. With many fields you obtain a long list of unstructured/unorganized fields. If it is not possible, is it planned please
                                                                                                  • Zoho Books - Cloud file picker storage solution order

                                                                                                    Hello, Is it possible to determine the order of the 3rd party storage solutions in the cloud file picker. We use Workdrive and the first one is Zoho Docs. It forces us to click every time on the Workdrive icon to reach the files. We'd like to position
                                                                                                  • Zoho Applications - What's New Alerts

                                                                                                    Hello, Sorry if I haven't checked enough, but is there a way to have email alerts on the "What's new" pages of each application please ? Correct me if I'm wrong, but today you have to go every day on each what's new page to know what has changed. By the
                                                                                                  • Invalid SupportPlan ID Create Contract error Zoho Flow to Zoho Desk

                                                                                                    I get the following when trying to create a contract in Zoho Desk from a webhook from Zoho Flow. "Zoho Desk says "Validation failed for the condition : Invalid SupportPlan ID""
                                                                                                  • Zoho Projects Currency fields in Deluge script

                                                                                                    I have several functions I've written in Zoho Projects that take one or more currency fields as input parameters (arguments). These functions have been working just fine for months, and I made no changes to any of them. Today (Jan 21, 2025) I noticed
                                                                                                  • ASAP widget broken?

                                                                                                    Hello, i've only just recently signed up and finding the whole set up a bit of a minefield. I've created and embedded the ASAP widget onto my website and a couple of things seem to be broken. 1. The launcher icon is missing 2. The form to submit tickets
                                                                                                  • Ticket owner for desk ticket can't be set using Zapier "Create ticket" function.

                                                                                                    I have a step in my zap where I create a ticket in desk, everything works fine apart from setting the Assignee (Ticket owner in desk). When I look at the data sent to the API the assignee variable has no data I can set the assignee (Ticket owner) if I
                                                                                                  • Adaptación de zoho books a la nueva regulación de facturación electrónica

                                                                                                    La facturación electrónica será obligatoria para todas las empresa en España en 2025, en Francia probablemente también e imagino pronto en todos los países europeos. Ya en 2024 todas las empresa grandes tienen que utilizar el sistema de facturación electrónica.
                                                                                                  • Email Body as Ticket Description

                                                                                                    Many of my customers use the support email instead of the portal to enter tickets. When this happens, the "Description" field is left blank. The email subject is automatically entered as the ticket subject when tickets are created this way - I would like
                                                                                                  • Next Page