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

      Zoho Desk Resources

      • Desk Community Learning Series


      • Digest


      • Functions


      • Meetups


      • Kbase


      • Resources


      • Glossary


      • Desk Marketplace


      • MVP Corner


      • Word of the Day


        • 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. 

        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

                                • 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.
                                • Enhance Zoho Flow's Jira Integration

                                  Hi, I hope you're doing well. We would like to request an enhancement to the Jira integration within Zoho Flow. Currently, Zoho Flow allows us to create and fetch users in Jira, but it lacks essential functionalities related to user management within
                                • Experience sharing - creating quick prototypes to align understanding

                                  Curious to hear from developers in this community - How do you create a prototype of Zoho CRM customised changes quickly with little coding so that you can validate your idea and requirements with stakeholders? The latest method I have found still requires
                                • 🔍 How to effectively organize data in a CRM? – My approach and questions for you

                                  Dear ZOHOssians! While working on organizing data in a CRM, I decided to use the native modules: Leads, Deals, Contacts, and Accounts as a solid foundation for managing processes. However, I’m now exploring the next steps and considering various options
                                • Filter a Zoho Creator main report by a field and display other related reports in sections on a Zoho Creator page

                                  Hi, How can I filter a Zoho Creator main report by a field and display other related reports in sections on a Zoho Creator page? Part of what I was given below is setting up sub-reports, but the subform field prompted me to link a form, not a report.
                                • Service Module: Multiple time duration choices on service

                                  Hi. I just discovered the Service Module in Zoho CRM. While defining my first service, I noticed that I can't select multiple durations. My services have booking choices for 1-6 hours. Is there a way to select multiple durations that I'm missing?
                                • Change an existing email name

                                  Can you change the name of an existing email address I have under my account?
                                • Introducing 'Queries' In Zoho CRM

                                  Hello everyone! We are here with an exciting feature - Queries in Zoho CRM! A little context before we dive right into the feature specifics :) In today’s fast-paced business environment, immediate access to relevant data is essential for informed decision-making.
                                • Zoho Show Slide Decks Not Accessible

                                  Hi. Currently, my Zoho Show slide decks are not accessible. Please fix it. My Writer files are still accessible, so I'd think something Zoho Show-specific has happened. Thanks!
                                • How to Add Portal Users in Zoho Creator's Development Environment for Testing?

                                  Hello, I’m working on a Creator app with a customer portal and implementing filters based on the logged-in user (customer). To test these filter functions, I'd like to simulate or add customer portal users in the development environment/database. Is there
                                • Whatsapp integration update.

                                  Please, there is no way on WhatsApp integration to know if a message has been read, or has been managed by a member of the team. There should be a way to add contextual info or something please.
                                • Introducing Formula Fields for performing dynamic calculations

                                  Greetings, With the Formula Field, you can generate numerical calculations using provided functions and available fields, enabling you to derive dynamic data. You can utilize mathematical formulas to populate results based on the provided inputs. This
                                • Is it possible to DISABLE emailing invoices?

                                  My husband's not real computer-savy.  I've set up Zoho so that he can enter invoices for his customers, but I don't ever want him to accidentally send an invoice before he's reviewed it.  Up until recently, emailing an invoice would send it to me (I don't
                                • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

                                  Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
                                • Syncing Fields Between Accounts AND Deals

                                  Please don't email me, I will check this thread for updates daily. I have a custom set of 10 fields (CFSET) in my account pages and deals pages. I want to fill them out on accounts pages per each, then when I make a new deal in an account, I want to copy
                                • Customer Statement Template

                                  Hi. how can i add order number "customer LPO number" in the customer statement. regards
                                • Unable to see clients/accounts from my CRM on Zoho Recruit.

                                  I am wanting to see my clients/accounts that are on my CRM within Zoho Recruit. CRM and Recruit seem to be integrated as I have access to all of the candidates, but there is no option to get my clients on there. I have activated the extension in marketplace
                                • need help to set up feeds to Zoho books with CRM Perks plugin

                                  Hi there, I need help setting up feeds with the CRM Perks plugin. It is supposed to send various feeds, like orders, payments, etc., from Woocommerce to Zoho Books. I have been trying so hard but seem to be too thick to get it done :-( For months, I worked
                                • Unable to add organization consultants and contractors in Zoho People

                                  Hello Team: I am unable to add my few consultants and contractors in Zoho People. How to add these people as Users?
                                • Zoho Books Bank Feed

                                  Good afternoon, Is it possible to change the bank feed provider on a bank account. I'm using Plaid but think that Yodlee would be better in terms of pulling transactions in a timely manner. Thank you.
                                • Setting default From address when replying to request

                                  At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com.  The first two are really internal address that should never be seen by the customer and
                                • Auto-Create OneDrive Folder Structure Upon Lead Creation

                                  Hello, New to Zoho and looking for help on a critical process automation I'm looking to implement. My company currently utilizes OneDrive for file management and the folder structure is Proposals -> Client Name -> Address (where I need to initially create
                                • Stock Count

                                  The stock count is a nice new feature, but we cannot figure out how to: 1. Use it without assigning to a person, we have a team or one of multiple do stock counts as do most any company. 2. Add any extra fields to what the "counter" sees. The most important
                                • Annoying Pop-Up Zoho Advertisements and Announcements Within Apps

                                  It is beyond frustrating to have to close out Zoho's announcements for Webinars, Zoholics, updates, events, etc while working within ANY of the Zoho apps. I see it when accessing Zoho One, Cliq, Creator, and CRM. Zoho boasts to be a professional solution
                                • 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
                                • Marking a Desk ticket as Unread after merge

                                  We have a custom script that runs against every new ticket and auto-merges it with any existing ticket that matches our criteria. That works fine but there is no functionality that reverts the newly-updated ticket back to an "unread" state. I found the
                                • Trying to do commission tracking with zoho crm, can i do a Lookup against multiple fields in a module?

                                  So i'm still designing my zoho one crm as i come over from salesforce. One of the things i'm trying to build is a commission tracking module. At some point i'll probably hire someone to help with custom code, I'm just proof of concepting it. I"m not sure
                                • Internal Support and Assigning Tickets

                                  I want to set up an Internal Desk Support system. Here is what I need... We need our internal "Support" staff to be the Ticket Owner We need to be able to identify who the "Account Manager" is on that client and get emails as part of the ticket. I'd like
                                • FAQs on Approval Process - Post your Questions

                                  Dear All, Greetings! Approval process allows to validate records and streamline the process across organization to ensure a systematic approach. To resolve your probable queries, we are constantly gathering relevant FAQs and publishing them to address
                                • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

                                  We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
                                • Introducing Social Toolkit

                                  Hi everyone, We're thrilled to launch Social Toolkit, a one-stop dashboard to help take your social media presence to new levels by letting you create aesthetic profiles and share content that your audience will actually enjoy engaging with. Social Toolkit
                                • Requesting a file upload in Zoho Workplace not possible?

                                  I’m new to Zoho Workplace and am mostly liking it. However, it seems as though collecting/requesting documents is not available in the workplace version of WorkDrive. Am I missing something, or would I need to subscribe separately to another WorkDrive
                                • Poor Email Delivery

                                  Our company used Zoho about 2 years ago and always had trouble understanding why a great deal of our emails from Zoho CRM and Zoho Marketing Automation ended up in the recipient's spam folder regardless of the email content and despite having our domain
                                • No table view in "All departmens" mode

                                  Hello, I would like to have an overview of all tickets, so I have to switch to "all departments". But here I don't have the possibility to activate the table view. But this is mandatory, so that I can see certain fields without having to open each ticket
                                • Where to Map Candidate fields to Employee fields in Zoho People 5.0

                                  I can not find options anywhere on Zoho people 5.0 where I can choose how the data fields are mapped from the candidate form to the onboarding form
                                • Get Creator Form Record ID and Subform ID's

                                  Good Afternoon everyone. I have a Creator form with a on success workflow. I'm trying to get the form record ID and the subform record ID(s) but they keep coming up null. There is data in the subform I use it elsewhere. Can anyone help me pull the ID's.
                                • WhatsApp and Zoho Creator Integration

                                  How we have integrate WhatsApp App with Zoho Creator without using external application ?
                                • 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
                                • Can we create Sprint with tasks from Multiple projects?

                                  Hi Team, We were using Zoho Sprints for quite sometime. Currently we have started the process of Sprint method. We couldnt create the active sprint board with the tasks from multiple projects. I would like to know whether this is possible or Any timeline
                                • Ability to use Dynamic goals in Motivator

                                  Is there any way to create dynamic goals in Zoho Motivator? By "dynamic" I mean: not the same target every period, but varying from period to period. For example, in our organization, sales reps are supposed to target beating the same month's sales last
                                • Next Page