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 modules using natural language prompts

                                    Hello all, We’ve introduced a new enhancement to Zia that allows you to create custom and team modules in Zoho CRM using plain language prompts. Why this enhancement? Creating a custom module traditionally involves multiple steps—choosing field types,
                                  • Boost collaboration in your sales process with Team Selling and Deal revenue's Split—empowering your Zoho CRM for smarter teamwork!

                                    This feature is currently available for the AU and SA DCs. It is being rolled out in a phased manner and will be available to all users shortly. Hello everyone, As you may all know, closing a deal is rarely a one-person effort. It often involves multiple
                                  • Suggesting enhance for criteria based data-sharing rules

                                    I suggest that, for user fields, the logged-user system variable could be used. This would allow the user, for example, to access records in which he/she is mentioned in a specific field, other than the owner. Thanks! Eduardo
                                  • How to sync read mails to GMail?

                                    Hello I am testing Zoho TeamInbox but I have an issue with my connected GMail account. Whenever I read a mail in TeamInbox or even reply to it, the email stays as "unread" in GMail. Is this normal behaviour? I thought that with the 2-way sync of IMAP
                                  • Look up field and show or hide section based upon selection

                                    Hi there, I am looking to show or hide a section within the opportunities module based on the value of the selection in the look-up field. This feature does not seem to be there Is there a workaround, and is this option coming in a future release? Thanks
                                  • eway Bill - Import (Good / Material)

                                    As we Importer of goods , for That first we Generate PO then , Payment, then after We create Bill of Entry  After Bill of Entry Anywhere (99%) cases material that arrived to port that comes to warehouse / factory for that Eway bill , we have to create
                                  • Import of Bank Statement DO NOT work - Date Mapping issue - Basic Feature Issue Becoming Serious Pain

                                    Hello, Yes, This is True. Importing Bank Statement feature is Not working as Intended. Facing few issues. Specially regarding the Mapping of Date field format. No matter how many times, we create a Case with Support team, they are NOT supporting in proper
                                  • Approval Workflow for Purchase Orders Abrir

                                    The requirement is , that all purchase orders greater than or equal to 5000 go through an approval process from certain people, but within books I only see that the approvers can be by levels or any approver but we cannot enter a rule like these. Can
                                  • How to see and amend Primary Clients easily

                                    Hi, i'm trying to make some reports on the clients we do projects for. However, i'm seeing a lot of "unknown" clients in the Zoho Analytics report. I suspect that these projects have not been assigned well and this needs to be corrected. Where can i easily
                                  • ZOHO NEEDS TO CREATE AN OPTION TO PASS CREDIT NOTE AGAINST SALES RECEIPT

                                    Zoho needs to find a way to pass credit note on sales receiptS. Creating a dummy invoice is causing major issues in tallying our sales figures and compliance with tax authorities.My system is tied to tax agencies and trying these options causes major
                                  • INTERGRATION OF ZOHO BOOKS PREMIUM PLAN AND ZOHO INVENTORY STANDARD PLAN

                                    Hello. I was using Zoho Books premium plan with 3 branches and has been working well until I purchased Zoho Inventory Standard plan. Now my 3rd branch location has been deactivate din Zoho Premium. how can I solve this please since I use all the locations
                                  • Exporting Templates

                                    I have just spent 2 hours creating a project template for a Netsuite configuration, and want to share it with other Zoho Projects users - who have a different account. Is there any way to do this?
                                  • Facing issue in getting data through api calls

                                    I have send data of users and want to get the data oof users but facing issue with one field for that I want help
                                  • It's time to say goodbye to Zoho Recruit for me.

                                    Hello, I have been a Zoho Recruit user since 2013. The tool has evolved, with a better UI, new features and so on. The pricing is still a great asset too. BUT, that being said, important features are not coming fast enough. I tried to share my point of
                                  • Automation#34: Schedule Guided Conversations (GC) Based on Business Hours

                                    Hello Everyone, Welcome to this episode on configuring your Guided Conversations (GC) based on your business hours. In our previous episode on Guided Conversations, we covered how to set up GC to enable offline support. This time, we'll guide you through
                                  • Download PDF from File Field with the name in another single line field

                                    Hi I am storing a PDF file in a File Field of a Form using Zapier automatically. now i need to download that file and set its file name as per the value stored in a single line field in that form. ANy turnout for that Thanks
                                  • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

                                    Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
                                  • TeamInbox and Desk Integration is Broken

                                    I use the TI -> Desk integration a lot. Today, it broke, again. When I go to create a Ticket from TI, an error message on a red background is shown "oops something went wrong". Checking the developers console on my browser, there are many 500 errors relating
                                  • Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000

                                    Hey, i get a error up "Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000" But i tried same passwords and info. to make imap on hotmail. and it works flawlessly. Has to be something with zoho....
                                  • Reply-To Match condition for Inbound Mail Messages

                                    I've trying to setup a rule to match the "reply-to" header but can't find any condition that would match this in Zoho TeamInbox rules. The business case is that I've setup my team inbox to be a member of a google group. The result of that is that emails
                                  • No Emails Flowing To Zoho TeamInbox

                                    From today, any emails we send to our TeamInbox addresses fail to be delivered. Our TeamInbox is connected via IMAP to 2 x Zoho Mail accounts. If I log in to those accounts directly via Zoho Mail, I can see all the emails landing in the inbox. The emails
                                  • How to download Renamed File that already updated to Zoho Creator.

                                    Hi members, I construct a button with report workflow. link = "https://creatorexport.zoho.com" + zoho.appuri + "report_link_name/File_upload/image-download/" + input.File_upload; openUrl(link,"new window"); This script able to download the file. But I
                                  • Merge Join PDFs Zoho Creator

                                    Hi all, I have a field where users upload PDF, is it possible to join those pdfs into one with a function or something? Regards.
                                  • Project Statuses

                                    Hi All, We have projects that sometimes may not make it through to completion. As such, they were being marked as "Cancelled". I noticed that these projects still show as "Active" though which seems counter intuitive. In fact, the only way I can get them
                                  • Mail API Get Email Attachment Content Returns HTTP Status 406

                                    Hi, I am trying to get the email attachments via the Mail API (https://www.zoho.com/mail/help/api/get-attachment-content.html) in PHP using CURL. I am able to get the Email Content and Attachment Info (https://www.zoho.com/mail/help/api/get-attach-info.html)
                                  • Not receiving email from Zoho to active account

                                    Dear Zoho, I have an account (giahuy@bincorporation.com) can not active to log in zoho. Status: inactive. Please help me to active that account. Thank you very much!
                                  • What is the reason I can't send emails

                                    What is the reason I can't send emails?
                                  • Kiosk Page Refresh

                                    We have a Kiosk running from a button in contacts to update values and also add related lists, which works great, but when the kiosk is finished the page does not refresh to show the changes. Is there a way to force the contact to refresh/update when
                                  • Zoho Desk app update - Activities module support

                                    Hello everyone! In the most recent version of the Zoho Desk Android app, we have brought in support for the 'Activities' module. You can now access activities as a separate module and manage your events, tasks, and calls within the mobile app. Also, you
                                  • Access invoice custom modules data from API

                                    Hi, I am using $url = "https://www.zohoapis.eu/invoice/v3/invoices"; $opts = ["http" => [method" => "GET",header" => [ "Authorization: Zoho-oauthtoken $accessToken", "X-com-zoho-invoice-organizationid: $orgId" ] ] ]; From my app to retrieve the invoices,
                                  • API - Inactive user

                                    Hi We have a complex flow set up with an API. Yesterday I needed to inactivate a user who had set up the flow and API- realised after this, then broke the connection so - re-activated the user. The flow now seems not to work when gaining information from
                                  • Creating task at someones date of birth

                                    Hi, I want to create a workflow which creates a task at someones date of birth. How can I do this?
                                  • Using lookup field in Formula field

                                    I created the following formula field to get string output based on Lookup field values Lead and Account: if(${Communications.Lead}!='','Lead',if(${Communications.Account}!='','Account','Other')) The syntax seems correct, but I'm still getting an error.
                                  • How to associate a document sent in Zoho Sign with an deal in the CRM?

                                    Hi, often documents are loaded in Zoho sign and sent for signature. These sometimes are linked to a deal in the Zoho CRM and would be nice to see the status of the document within the CRM. I am aware of the integration, but that assumes that the document
                                  • Inventory valuation

                                    Inventory valuation in case of sales return makes some error in getting proper value of inventory. Cost price considered for accommodating the goods returned is not the price at which cost of good sold where recorded, last purchase of the same item is
                                  • Where do we manage tags?

                                    Where is the page where we can view all tags and manage them (like change a tag name to something else or merge tickets under a particular tag with another)?
                                  • Google Ads Data is Publicly available in Zoho CRM

                                    We recently discovered that ALL of the following Google Ads fields are visible to all users in our CRM that have access to either Leads or Contacts modules. Not only is this troubling and inconvenient, it should be unacceptable. It also creates a mess
                                  • Enhanced duplicate check for Leads in CRM

                                    Hello Everyone, We are excited to announce that you can now check for duplicate entries in leads by comparing them with similar records in the Contacts Module. Previously, when you added a lead, only the converted leads were checked for duplicates. This
                                  • Improved record access with the Default Access Level feature

                                    Greetings, I hope you're all doing well. We're excited to introduce Default Access Levels, which enable you to grant access to your peers' records when necessary. What problem does it solve? Organizations typically have hierarchies wherein higher-level
                                  • Introducing Assessment-based Filters in Zoho Recruit

                                    We're thrilled to announce a handy new feature: Filtering Candidates by Assessment Answers. This tool allows you to refine your candidate search based on their performance in screening tests or assessments. It's a great way to find candidates who meet
                                  • Next Page