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



      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • 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. 
          • 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. 
          • Welcome to Zoho Desk Community - Say hello here!

            Hello everyone! Though we have been here for a while, it’s time to formally establish the Zoho Desk Community; we’re really happy to have you all here! This can be the place where you take a moment to introduce yourself to the rest of the community. We’d love to hear all about you, what you do, what company or industry you work for, how you use Zoho Desk and anything else that you will like to share! Here’s a little about me. I am Chinmayee. I have been associated with Zoho since 2014. I joined here
          • Webinar 1: Blueprint for Customer Service

            With the launch of a host of new features in Zoho Desk, we thought it’ll be great to have a few webinars to help our customers make the most of them. We’re starting off with our most talked about feature, Blueprint in Zoho Desk. You can register for the Blueprint webinar here: The webinar will be delivered by our in-house product experts. This is a good opportunity to ask questions to our experts and understand how Blueprint can help you automate your service processes. We look forward to seeing

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ




                                ご検討中の方

                                  • Recent Topics

                                  • Converting Sales Order to Purchase Order

                                    Hi All, Firstly, this code works to convert a sales order(SO) to a purchase order (PO) via a button, however I am running into an issue when I convert the SO where the values from the line items are not pulled across from the SO to the PO. The ones in
                                  • This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details

                                    Hello, Just signed up to ZOHO on a friend's recommendation. Got the TXT part (verified my domain), but whenever I try to add ANY user, I get the error: This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details I have emailed as well and writing here as well because when I searched, I saw many people faced the same issue and instead of email, they got a faster response here. My domain is: raisingreaderspk . com Hope this can be resolved.  Thank you
                                  • Select CRM Custom Module in Zoho Creator

                                    I have a custom module added in Zoho CRM that I would like to link in Zoho creator.  When I add the Zoho CRM field it does not show the new module.  Is this possible?  Do i need to change something in CRM to make it accesible in Creator?
                                  • In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote

                                    In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote Pls help how i fix this
                                  • Nimble enhancements to WhatsApp for Business integration in Zoho CRM: Enjoy context and clarity in business messaging

                                    Dear Customers, We hope you're well! WhatsApp for business is a renowned business messaging platform that takes your business closer to your customers; it gives your business the power of personalized outreach. Using the WhatsApp for Business integration
                                  • Custom Print Button in Page/Stateless Form

                                    [Zoho Creator] Unable to Add Custom Print Button to Page or Stateless Form We need the ability to add a custom print button on a page or stateless form in Zoho Creator to print a templated or formatted output (e.g., appointment confirmation, summary slip).
                                  • Unified customer portal login

                                    As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
                                  • Invitation-Based User Access in Zoho Analytics

                                    Hello everyone, We’re rolling out an important update on how users are added to your Zoho Analytics Organization and Workspaces. Previously, when admins added users, they were automatically added to the organization. Moving forward, to improve security
                                  • Ask the Experts 21: Power up your support game with Zoho Desk Automation

                                    " In every business, there are tasks to automate, Zoho Desk helps with features that integrate Assignments to manage tickets and teams to align,Macros for quick actions and workflows to streamline Contracts and schedules to hold things tight, Plans run
                                  • CRM calendar not syncing with Zoho Calendar

                                    The sync is not happening: This is my Zoho Calendar CalDAV synced with Outlook This is my Zoho CRM Calendar (sadly empty ...) I have enabled CalDAV Access. In Zoho Calendar, I have set up APP Calendar sync like this: What else can I check? Thank
                                  • Automating Employee Birthday Notifications in Zoho Cliq

                                    Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
                                  • Page Variable Not Passed from Report to Form

                                    [Zoho Creator] Page Variable (Resource) Not Passed from Report to Form in Appointment Module We are facing a limitation in our Appointment Module related to the handling of page-level variables. We are using a page variable to select a resource, which
                                  • Zoho.eu and U.S. Cloud Act? Can U.S. request Zoho.eu data?

                                    Given the current political situation in the U.S. and possible near future implications for data privacy and security, I am curious about Zoho’s obligation to comply with the U.S. cloud act or other U.S. requests for private customer information from
                                  • Client Script | Update - Client Script Support For Custom Buttons

                                    Hello everyone! We are excited to announce one of the most requested features - Client Script support for Custom Buttons. This enhancement lets you run custom logic on button actions, giving you greater flexibility and control over your user interactions.
                                  • Introducing Zoho CRM for Everyone: A reimagined UI, next-gen Ask Zia, timeline view, and more

                                    Hello Everyone, Your customers may not directly observe your processes or tools, but they can perceive the gaps, missed hand-offs, and frustration that negatively impact their experience. While it is possible to achieve a great customer experience by
                                  • Issue with Missing Scope for Creating Service Report via Zoho FSM API

                                    Hello @Latha Velu , I am currently working on creating a connection to create a Service Report in Zoho FSM using the API. However, while configuring the required scopes, I noticed that the scope ZohoFSM.modules.ServiceReports.CREATE which
                                  • Function #55: Convert multiple quotes to single SO using Custom Button

                                    Hello everyone, and welcome back to our series! In Zoho Books, after a quote is accepted by your customer, it can be converted into a sales order or an invoice. Often, a customer might have multiple quotes, and for easier billing or upon the customer's
                                  • Mass Print Attachments from Selected Records in Custom Module

                                    Dear Zoho CRM Team, We’d like to request a feature enhancement regarding the handling of attachments. Use Case: We have a custom module that stores invoices uploaded by our affiliates. Currently, we need to open each record individually to print these
                                  • Haven't used banking function for years and now want to reconcile and clean up my account

                                    I'm in the UK and have been using Zoho Books for my private mental health practice since 2018. Up until recently, I've entered everything manually and not reconciled any items with my bank account. Every year, I run a report for that year and use that
                                  • Experience effortless record management in CRM For Everyone with the all-new Grid View!

                                    Hello Everyone, Hope you are well! As part of our ongoing series of feature announcements for Zoho CRM For Everyone, we’re excited to bring you another type of module view : Grid View. In addition to Kanban view, List view, Canvas view, Chart view and
                                  • MS Teams Meeting to Zoho CRM

                                    Has anyone figured out a good way to push MS Teams meeting info on a trigger of "meeting end" to Zoho CRM? We're looking for a way to take attendees of a meeting and meeting duration and push it into Zoho CRM after the meeting has ended. If I can just
                                  • Creating Layout Rule With Formula Field

                                    By The Grace Of G-D. Hi, I see that i cannot use Layout Rules to show/hide Formula Fields. Is that something you plan on adding sometime soon?
                                  • Writing SQL Queries - After Comma Auto Suggesting Column

                                    When writing SQL Queries, does anyone else get super annoyed that after you type a comma and try to return to a new line it is automatically suggest a new column, so hitting return just inputs this suggested column instead of going to a new line? Anyone
                                  • Using the "Like" operator in Custom Formula

                                    HI there, Can someone please explain the way to use the "LIKE" operator in an IF statement to compare strings? I have tried the following but am not getting the results I'm after. if( "CurrentStatus" like 'Rejected*','Unsuccessful','Pipeline') Thanks Matt
                                  • Zoho CRM Two currencies on one record

                                    Hello all, Our country is planning to transition to Euro from our local currency. The government is planning to mandate that all companies show their invoices, quotes, etc. in both currencies for a period of one year in order to protect from speculation.
                                  • Combine / merge multiple invoices into master

                                    Good morning Zoho! Upon looking for a solution for my issue, I found many that had my similar problem...dating 13 years ago! Please, any updates on this? Merging multiple invoices on a Master Invoice would alleviate all the extra work of resending and
                                  • Free Webinar Alert! Productivity Hacks that you don't want to miss on June 24

                                    Hello Zoho Community! Want to work smarter and get more done with Zoho Mail? We’re here to help! Join our interactive webinar to explore powerful Zoho Mail features that can boost your productivity. Watch live demos, learn helpful tips, and take part
                                  • Web Clipper cannot save to collections

                                    With the recent update that added collections, i am unable to use the web clipper to save to a collection
                                  • Set File Upload fields as mandatory

                                    Currently the CRM for some reason lacks the ability to set a file upload field as mandatory So we have an issue We have a requirement that before a Deal stage is set as Deal is Won the member needs to upload a file Now for some weird reason in Zoho I
                                  • sort by name is always z to a

                                    I typically keep my notes in alphabetical order. Suddenly they are all backwards - z to a. They stay that way whether I select a to z or z to a. Is there a way to fix this?
                                  • Project Management Bulletin: June, 2025

                                    Our project management suite's representatives have been busy socializing with global customers in the USA (Zoholics) and Australia (roadshows). We also had multiple stop overs at our customer’s establishments and were glad to see the efficiency our products
                                  • How to get values from both tables in Join in COQL query in Zoho API

                                    In this below query I can get value either from Deal Table or from Contact table. If I wanted data from both the table it is not working. Can you please help me with this. Thanks in advance. {     "select_query": "select ,A.Deal_Name,B.First_Name,B.Last_Name,
                                  • Agenda For Zoholics Benelux & Nordics 2025

                                    Dear Zoho Benelux community, We are pleased to announce the agenda for Zoholics Benelux & Nordics 2025 on September 23-24 at NBC Congrescentrum in Nieuwegein. The topics of the presentations are: Zoho innovations in the region and worldwide The introduction
                                  • Report Level Button

                                    Currently I couldn't find a way to add a report level button I think currently we can only add buttons/actions for records, but having record based levels would be really beneficial Usecases Click to import/sync Data from On Prem Systems Click to Perform
                                  • How to query Deal "Stage" "Is Open" in Analytics SQL?

                                    How do I query this "field" in Analytics? What is going on? It seems like there is another 'mapping' somewhere but that it is inaccessible with raw sql??? If I query "Stage" Like '%Won%' I get a wildly different number than I do when I manually filter
                                  • Knowledgeable Image Quality is very poor, any recommendations how to improve this?

                                    Hi All, We are looking at migrating our current knowledge base to Zoho so it can be kept in one location. Our current KB utilises a lot of images to try and make it easier for users and less wordy. Unfortunately, when I upload an image within an article,
                                  • Desk - CRM Integration: SPAM Contacts (Auto Delete)

                                    SPAM contacts is a useful feature, but when the CRM sync is used, it is very frustrating. When a contact is marked as SPAM on Desk, I wish to do the same on CRM. When a SPAM contact is deleted, I would like it deleted from CRM. The feature looks half-baked.
                                  • CRM notes

                                    I want to be able to add notes to a task that do not necessarily get rolled up into an account or contact.   For example, I tasks to work on a Court Order for John Doe divorce account.  There might be lots of updates (in the form of notes) that employees
                                  • Multi-Select lookup field has reached its maximum??

                                    Hi there, I want to create a multi-select lookup field in a module but I can't select the model I want the relationship to be with from the list. From the help page on this I see that you can only create a max of 2 relationships per module? Is that true?
                                  • Enhanced Candidate Portal: Now Featuring Federated Login, Passwordless Access & MFA

                                    You can now enhance your Candidate Portal experience with Federated Login, Password less Sign-in and Multi-Factor Authentication (MFA). These features offer greater flexibility and control—allowing seamless sign-ins through trusted platforms and adding
                                  • Next Page