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

                                  • CREATE REPORT USING TWO FORMS

                                    ONE FORM CONTAINS LIST OF ALL CLIENTS WHOSE RETURN IS FILED AND OTHER FORM CONTAINS LIST OF RETURNS FILED YEARWISE. NOW I REQUIRED A REPORT OF ALL CLIENTS WHOSE RETURN ARE PENDING FOR A PARTICULAR YEAR
                                  • Make other sub fields mandatory, if first subfield is not empty

                                    I am not finding an option in the rules to make other sub fields mandatory if the first sub field is not empty. I am using the name field to collect parts info, with sub fields of Part Name, Part Number, and Quantity. But I don't want these mandatory
                                  • How to normalize CRM module when integrating with Survey?

                                    This question is about the problem with many-to-many relationships and Survey. One of the things our organization does is track people in our program and their jobs. We get new information from the people three times annually through Zoho Surveys. Survey
                                  • Poor Search Results on Zoho CRM

                                    The search on Zoho CRM is quite poor. Salesforce has now published a new search, when will get this on Zoho? https://help.salesforce.com/s/articleView?id=data.c360_a_hybridsearch_index.htm&type=5
                                  • Parentheses in System Path

                                    Zoho WorkDrive includes a mandatory parenthesis with the organization name in the desktop sync client. This adds parens to the system path. Many command-line applications do not allow for the use of parenthesis, so if you want to use a file saved on WorkDrive in a command line you cannot. Most major document syncing platforms do not allow parenthesis for this reason.
                                  • Introducing Assemblies and Kits in Zoho Inventory

                                    Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
                                  • Associating Multiple Work Orders with a Single Invoice in Zoho FSM

                                    Hello Everyone, Is it possible to associate multiple Work Orders with a single Invoice in Zoho FSM? Best Regards, Subhash Kumar
                                  • Client Script Quality of Life Improvements #1

                                    Since I'm doing quite a bit of client scripting, I wanted to advise the Zoho Dev teams about some items I have found in client script that could be improved upon. A lot of these are minor, but I feel are important none-the-less. Show Error on Subform
                                  • [Webinar] Evolving BI & Analytics in the Age of AI

                                    Artificial intelligence is redefining how data is collected, analyzed, and leveraged across industries. As businesses strive to become more agile and insight-driven, traditional BI and analytics must transform to meet new demands. AI-first organizations
                                  • 請求書に添付されているファイルをAPI経由で取得する際の問題について

                                    Books APIリファレンス 現在、Books APIを利用して請求書内の添付ファイルを取得するメソッドを構築しています。以下のコードを参考にしているのですが、添付ファイルが複数アップロードされている場合、responseにおいて2つ目のファイルの情報しか取得できない現象が発生しています。 headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
                                  • Zoho CRM and Books Integration

                                    Evening, I have started the integration with FSM from CRM and having difficulties with the mapping. In CRM we use "Unit Price" as our cost price and mark this up on a subform to create a "Sell Price" this markup can be different on each quote depending
                                  • Leadchain into a custom module

                                    Hello ZOHO Community ! is it possible to put the leads collected by leadchain into a custom module instaed of leads module ? Best wishes Niels
                                  • Zoho Flow to Azure Devops

                                    hi, i'm getting this when trying reauthorize the connection from Zoho Flow to Devops but when i look in Devops there is no service connection related to Zoho So i do not know where i have to renew the mentioned client secret..
                                  • 533 Relaying disallowed

                                    When I try to send an email from my Zoho account, it gives me that error 533: relaying disallowed. What should I do? Please help.
                                  • Formula Module how to convert to percentage

                                    Hello There, I have create a formula field and i want the outcome to be in percentage how do i do that This is my formula ${Deals.Forecast Revenue Per Year}/${Deals.Annual Processing Volume} I have try ${Deals.Forecast Revenue Per Year}/${Deals.Annual
                                  • Sandbox - Your Secure Testing Space in Zoho Projects

                                    Managing projects often involves fine-tuning processes, setting up new automations, or making configuration changes. Making those changes directly in a live environment leaves no room for trial and error. Sandbox in Zoho Projects is a dedicated testing
                                  • Importing into Multiselect Picklist

                                    Hi, We just completed a trade show and one of the bits of information we collect is tool style. The application supplied by the show set this up as individual questions. For example, if the customer used Thick Turret and Trumpf style but not Thin Turret,
                                  • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

                                    Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
                                  • Third party apps for my mail

                                    Hello im new here and i have a very important issue. A third party company uses one of my emails to send invoices to our customers. My problem is that cannot connect to zoho mail server. my imap settings are corrent imappro.zoho.eu 993 smtppto.zoho.eu
                                  • 553 relaying disallowed invalid domain

                                    Hi, I have read the previous article but i am still facing issue , I have added all these in my domain manager under dns settings. type : cname host: zb14521202 value / points to : validate.zoho.com Can you please tell me why i am still facing same issue
                                  • Announcing new features in Trident for macOS (v.1.18.0)

                                    Hello everyone! Trident for macOS is here with interesting features and enhancements to elevate your workplace communication and productivity. Let's take a quick look at them. Retract sent emails. Whether you've missed adding an important attachment or
                                  • How do I add more space to a note in ‘draw’?

                                    I’m taking handwritten notes using the draw note, but I don’t seem to be able to scroll down to get more room on the page. How do I make more room to take notes?
                                  • Este domínio já está associado a esta conta

                                    Fui fazer meu cadastro na zoho e quando digitei meu domínio recebi essa mensagem que meu domínio estava associado a uma conta que eu nem faço idéia de quem seja. Como que faço pra resolver isso? Atenciosamente, Anderson Souza.
                                  • USA Military addresses

                                    When we have a client with a US military address adding them to the CRM, or having them fill in a form is a problem. Zoho Forms and CRM doesn't seem accommodate them correctly. It doesn't make sense for me to have to create a secondary data model for
                                  • Canvas View Change History

                                    We are trying to setup Canvas Views and it is really not a pleasant experience. It bugs a lot, some pages are just not accessible anymore and it shows that a view is just not editable because it shows a blank page, although when we open an actual record,
                                  • Office 365 is marking us as "bulk"

                                    All of a sudden (like a couple of days ago) all of our customers who are on Office 365 are getting our mails in their junk email. This is not the case with Gmail or other random mail servers, nor between us. We got a 10/10 score on mail-tester.com. Also,
                                  • Leadchain BUG

                                    Hello i have a problem with Facebook Leadchain. All of the information is populated correctly in the CRM, except the campaign. I want to add new leads to an existing campaign, but the lead is not added to the campaign even tough i have selected the campaign
                                  • What is the use of the stage environment ?

                                    Salut, I am woundering what is the use of the stage environment. Usually, I do all the testing in developpement, and then go straight to production. The only thing I cannot test in developpement, is the result for portal users. Could the stage environment
                                  • Workflow Automation Instant Action

                                    Hello All I need help to resolve this. I have created a few workflow 1. When Deal Stage is Submitted to Onboarding, it will create a record in my Onboarding Module 2. When Deal Stage is Live, It will copy $Deal.GOliveDate to $Onboarding.GoLiveDate For
                                  • Live webinar: Transitioning from MS PowerPoint to Zoho Show

                                    What’s the first word that comes to mind when you think of presentations? For many, it’s PowerPoint. This has been the default for so many years that “PPT” has become a stand-in for “presentation.” But presentation needs are changing. And if you’re looking
                                  • Short Custom Order

                                    Hi Everyone, I have question, i create some report use custom short order like below. But this is just show in development mode.... when i publish to production, it is not showing. And this is just showing in full admin mode. Can setting to show roles
                                  • Introducing Keyboard Shortcuts for Zoho CRM

                                    Dear Customers, We're happy to introduce keyboard shortcuts for Zoho CRM features! Until now, you might have been navigating to modules manually using the mouse, and at times, it could be tedious, especially when you had to search for specific modules
                                  • Assistance with Bulk Contact Import in Zoho Email Campaign

                                    I’m currently in the process of importing the Supermarkets customer list from Zoho Accounts into Zoho Email Campaigns. During the import, I’m being prompted to complete the "field mapping" section, but I’m unsure how to properly configure it to ensure
                                  • 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
                                  • Variables in Zoho Mail Signatures defined by Administrator

                                    Good afternoon, I'm looking at the Admin component of Zoho Mail, and I see we have the capability to define signatures for end users. We also have the ability to associate with multiple email addresses. Are we able to use any variables such as [FirstName}
                                  • Custom view placeholders

                                    Hi all, On some occasions it would be great to have placeholders setting up a custom view. Example in our case we have a field for a year. We would like to have a placeholder like $.{CurrentYear} that will insert the current year 2025 e.g. Now we have
                                  • Article Numbers for KB articles

                                    Hello, I was wondering if it's possible to turn on article numbers/ part numbering for KB articles. If this is not already a feature, we'd like to request it. Frequently a solution will require multiple articles so tracking which articles are referenced
                                  • Sales Order automatic Convert to Invoice using boolean True or false

                                    It is possible to convert the Sales order to an invoice using a boolean field, true or false Example: I create a field in my Sales Order, I name it QBO Invoice, and the field type is Boolean, true or false. Let's say the default is false, so when I change
                                  • IMPORTRANGE Spreadsheets

                                    I am trying to importrange a spreadsheet into another, but an error keep appearing saying NOT LINKED. Noting that I've linked it. I've tried to publish both sheets and re-apply the formula many times but nothing is working. I don't know what can I do
                                  • Should I save dead quotes

                                    I work in vehicle transport, specializing in transporting vehicles for dealerships. My role involves collaborating with individuals at each dealership to facilitate the transport of their vehicles to customers and from auctions. My question is whether
                                  • Next Page