Automation#25: Move Tickets to Unassigned When the Owner Is Offline

Automation#25: Move Tickets to Unassigned When the Owner Is Offline




Hello Everyone,

Welcome to this week's Community Series!

'Tis the holiday season—a time when work often takes a brief pause. 

The holiday spirit is in full swing at Zylker Techfix too, with employees taking some well-deserved time off. During this period, ticket owners are frequently offline at work.
Amid the holiday hustle and bustle, customers continued responding to tickets. Unfortunately, tickets assigned to agents on leave went unnoticed, as they were not listed under unassigned requests.

Zylker Techfix needed a solution to ensure such tickets were reassigned to "Unassigned," preventing any customer requests from being overlooked. This is where a custom function came to the rescue, just in time!

Here’s how you can use this custom function to move tickets automatically to "Unassigned" when the ticket owner is offline and a customer replies. 
Follow these steps to implement the custom function within a workflow rule.

Prerequisites
1. Create a connection
  1.1 Go to Setup(S) 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.settings.READ
Desk.basic.READ
Desk.tickets.UPDATE
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 Customer Reply.  
8. Click Next.
 
9. In the Criteria section, select Ticket Owner is not empty. click Next
10. In the Actions section, click the + icon and select New next to Custom Functions.
12. Enter a Name and Description for the custom function.     
                                      
13. In the script window, insert the Custom Function given below:
  1. // ----<<<< User Inputs >>>>----
  2. // --- Replace ".com" with appropriate domain extension based on customer's location/DC --- 
  3. deskURL = "https://desk.zoho.com";
  4. //Replace your Current Configured Department Id
  5. departmentId = "DEPARTMENT_ID";
  6. // ----<<<< Initial Configs >>>>----
  7. logs = Map();
  8. onlineAgentsId = List();
  9. //---------------------------
  10. try 
  11. {
  12. // ---- start your logic from here ----
  13. getTicketInfo = invokeUrl
  14. [
  15. url : deskURL + "/api/v1/tickets/" + ticketId
  16. type : GET
  17. connection : "deskconnection"
  18. ];
  19. logs.insert("getTicketInfo":getTicketInfo);
  20. assigneeId = getTicketInfo.get("assigneeId");
  21. onlineAgentsInfo = invokeUrl
  22. [
  23. url : deskURL + "/api/v1/onlineAgents?departmentId="+departmentId+"&limit=100"
  24. type : GET
  25. connection : "deskconnection"
  26. ];
  27. logs.insert("onlineAgentsInfo":onlineAgentsInfo);
  28. if ( onlineAgentsInfo != null && onlineAgentsInfo != "" && onlineAgentsInfo.get("data").size() > 0 ) 
  29.     {
  30. for each agentInfo in onlineAgentsInfo.get("data")
  31.         {
  32. onlineAgentsId.add(agentInfo.get("agentId"));
  33.         }
  34.     }
  35. logs.insert("onlineAgentsId":onlineAgentsId);
  36. if (!onlineAgentsId.contains(assigneeId.toString())) 
  37.     {
  38. ticketUpdate = invokeUrl
  39. [
  40. url : deskURL + "/api/v1/tickets/" + ticketId
  41. type : PATCH
  42. parameters : {"assigneeId":""}+""
  43. connection : "deskconnection"
  44. ];
  45. logs.insert("ticketUpdate":ticketUpdate);
  46.     }
  47. }
  48. catch (errorInfo)
  49. {
  50. logs.insert("errorInfo":errorInfo);
  51. }
  52. info "logs: \n" + logs;
  53. if(logs.containKey("errorInfo"))
  54. {
  55. throws "Error happen in the CF execution";
  56. }

Notes
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 5, add the departmentId of the department where you want to configure this custom function.
How to fetch the DepartmentId? 
To find the departmentId, navigate to Setup (S) >> Organization >> Departments.
Select the department where you want to configure the custom function. Copy the numerical ID at the end of the URL from the address bar.

14. Click Edit Arguments and include the argument mapping as below: 
  14.1 In the Name field, type ticketId and select Ticket Id under the Tickets Section.

15. Click Done.  
16. Click Save to save the custom function.
17. Click Save again to save the workflow.

Our Community Series is here to provide practical tips and solutions. If you have any questions or suggestions, feel free to reach out to us at support@zohodesk.com—we’d love to hear from you!

Wishing you a joyful and productive holiday season. 

Until next time,
Best Wishes,
Lydia | Zoho Desk 

    Access your files securely from anywhere


            Zoho Developer Community





                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                      • Ask the Experts



                                          Zoho Marketing Automation
                                                  • Sticky Posts

                                                  • Zoho Desk Virtual Meetup: US Central, October 5 - 7, 2021

                                                    After the interactive Virtual Meetups in the other regions, we are starting with the US Central and Midwest regions from October 5 to October 7, 2021. The dates for other regions will be announced soon.  At this event, we will explore the topics which
                                                  • Register for Zoho Desk Beta Community

                                                    With the start of the year, we have decided to take a small step in making the life of our customers a little easier. We now have easy access to all our upcoming features and a faster way to request for beta access. We open betas for some of our features
                                                  • Share your Zoho Desk story with us!

                                                    Tell us how you use Zoho Desk for your business and inspire others with your story. Be it a simple workflow rule that helps you navigate complex processes or a macro that saves your team a lot of time; share it here and help the community learn and grow with shared knowledge. 
                                                  • Zoho Desk Community Meetups 2019 - Canada

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

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


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

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

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Notes Filter is not working

                                                                                                    I am trying to filter the CRM down to specific notes that I want that'll show up all the data that has a specific keyword for example, "stocks" and it says no leads are found... Don't know how to fix. don't know if it's a system glitch. I even put a note
                                                                                                  • Customize the Date Format based on preference

                                                                                                    Hello Everyone, We have rolled-out a new field called Date Pattern in the user layout under Locale information. Note: If you notice any change in the date format after this roll-out, please select your preferred format from the settings. Previously, the format of the date was automatically set on the basis of the country locale selected by the user. Now, the user will be able to edit the format in which the date is displayed according to their preference.  The Date pattern field has around 40 patterns
                                                                                                  • Zoho Support is Dysfunctional & Don't Know Their Own Support Hours

                                                                                                    Seeking clarification on Zoho support hours and contact numbers please. We have been trying to phone Zoho support on +61 2 8066 2898 at 9:20am AEDT for the second day in a row, and gotten a message on Zoho's support line: "support is open monday through
                                                                                                  • Field Updated based off Call Status

                                                                                                    I'm trying to create a Field Update where: When Call Status is Completed Lead/Contact/Account Description field with the information in the "Outcome Of Outgoing Call" Description field. Once our sales team finishes their calls and they add a description
                                                                                                  • 【参加無料】3/19 東京ユーザ交流会 参加登録 受付開始!(新橋開催)

                                                                                                    ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 3月19日(水)に東京、新橋でユーザー交流会を開催します! 今年最初のユーザー交流会 東京・新橋では、Zoho Champion の松井さん、鈴田さんが登壇します。 Zoho CRM活用事例のセッション、参加者同士で自社の活用・運用について情報交換ができるグループワークや、CRM / Marketing Automationに関するパネルディスカッションも予定しています。 ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
                                                                                                  • Zoho CRM Workflow and Function Backup Options

                                                                                                    Hi everyone! I have been able to make several backups of my CRM data and noticed that the Workflows and Functions are not included in these backups. To my knowledge, there is no backup feature for workflows and functions, which is problematic in of itself.
                                                                                                  • Automating CRM backup storage?

                                                                                                    Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                                                                                  • Bulk Delete / Archive

                                                                                                    For me the Bulk delete and archive functions are not working anymore reliable. I get the message that the action is scheduled, but often it is not executed not even minutes later. To me, the user experience became terrible in the last month. It used to
                                                                                                  • Chat function not working properly

                                                                                                    Ever since upgrading to plus, the chat is all messed up. it is coming up behind the web page so that I cannot see what I'm typing and cannot read replies. I can only see the bottom of the text box at the bottom of the page, and then it is blocked. I've
                                                                                                  • Passing Information from ZohoCRM to ZohoCreator

                                                                                                    I've got a use case where I'm attempting to use a button within ZohoCRM to pull a list of options into buttons on creator when page is loaded. I'm pretty well versed in Deluge, but I'm having a difficult time trying to understand how to dynamically place
                                                                                                  • Scheduled function not firing workdrive.uploadFile task

                                                                                                    I have a creator app that takes submissions from a published form. I setup a daily scheduled function to send a record template of the form, as well as 3 different uploaded files to workdrive folders. (Initially I intended for this to happen on the submission
                                                                                                  • Automatic Email Alerts for Errors in Zoho Creator Logs

                                                                                                    Hello, We would like to request a feature enhancement in Zoho Creator regarding error notifications. Currently, Zoho Creator allows users to view logs and errors for each application by navigating to Zoho Creator > Operations > Logs. However, there is
                                                                                                  • E-mails to suppliers

                                                                                                    Hi, i want to upload a spread sheet every day and send an e-mail to our suppliers every day (or when triggering a button?) with info from the spreadsheet lines. The supplier e-mail would be on each line. Unfortunately, when creating a scheduled automation,
                                                                                                  • Rearrange web - hidden components

                                                                                                    When you have a good number of forms, reports and pages, searching for one among the hidden components to add it to the menu is simply hell. Huge amounts of time are wasted.
                                                                                                  • Using Insert into to transfert a date in another form

                                                                                                    Hi, I have an order form that creates a record in a calendar form, for managing the delivery date. My customer can change that date in the calendar form, but i need the new date to be put in the original order form. I tried the following but it doesn't
                                                                                                  • Invoice import error - duplicate customer name column - there are no duplicates

                                                                                                    It is not allowing the importing of any rows because of a duplicate customer name problem, but there are no duplicates in the custoemr name row. Has anyone dealt with this issue before?
                                                                                                  • Introducing the New SalesIQ Live Chat Widget: Twice as Fast, Fully Optimized for Engagement!

                                                                                                    Hello everyone! To celebrate our 10-year milestone, we're thrilled to unveil the new and improved SalesIQ Live Chat Widget! Redesigned at both the User Interface and performance levels, this enhanced widget is not only optimized but also 2X faster than
                                                                                                  • Now Indian Businesses can start accepting online payments with Zoho and Razorpay

                                                                                                    Hello Everyone, At Zoho, we have always ensured a hassle-free online payment experience for our customers. Today, with our integration with Razorpay, Zoho's customers from India can now offer a seamless checkout experience for one-time and recurring payments, with a host of payment options including card payments, multiple wallet offerings, and net banking with over 50 banks. With Zoho and Razorpay, help your customers pay their way. Whether it's with debit cards, credit cards, wallets, or net banking,
                                                                                                  • Store Google reCAPTCHA Site Keys & Secrets in Zoho Forms

                                                                                                    Hello Zoho Forms Team, We appreciate the support for Google reCAPTCHA v2 (checkbox) and reCAPTCHA v2 (Invisible) in Zoho Forms. However, we have a significant usability concern regarding the current implementation. Current Limitation: Every time we want
                                                                                                  • Enable Organization-Wide reCAPTCHA Settings in Zoho Forms

                                                                                                    Hello Zoho Forms Team, We appreciate the existing security options for Zoho Forms, including Google reCAPTCHA v2 (checkbox) and reCAPTCHA v2 (Invisible). However, we have a major usability concern: Current Limitation: Right now, CAPTCHA is a form-specific
                                                                                                  • Add Support for Google reCAPTCHA v3 in Zoho Forms

                                                                                                    Hello Zoho Forms Team, We appreciate the security measures currently available in Zoho Forms, including Zoho CAPTCHA, Google reCAPTCHA v2 (checkbox), and reCAPTCHA v2 (Invisible). However, we would like to request the addition of support for Google reCAPTCHA
                                                                                                  • Last Name / First Name

                                                                                                    Hello ,  My company adds contacts on a "Last Name , First Name" basis. We've noticed that when viewing accounts there is no  " , " (comma). It's VERY misleading.  I have set the custom view to show "last name" "first name" instead it joins them both and merges them. Even after you create a contact and you re enter it states "contacts name" instead of "last name" , First name" I have already changed the arrangement of name display in user settings. We need to be able to distingush name orders. Attached
                                                                                                  • Desk Contact Name > split to First and Last name

                                                                                                    I am new to Zoho and while setting up the Desk and Help Center, I saw that new tickets created or submitted from the Help Center used the Contact Name field. This would create a new Contact but put the person's name in the Last Name field only. The First
                                                                                                  • Extract first and last name

                                                                                                    I am trying to build a custom function in Flow, when a new Zoho Booking is added I want to split the Name field into first last name.  I understand the function needs to be a string and this works but I am unsure how to write this in the flow script.  result = first_name.getPrefix(" "); info result; I also assume to then create the last name Ill use the same but getSufix  Any help greatly appreciated.  :-)
                                                                                                  • Import template from Zoho Writer

                                                                                                    I am trying to import a mail merge template - tried to import direct from my .docx file on my hard drive and the formatting went all over the place.  I then imported the .docx file in my Zoho Docs and then fixed up the formatting within Zoho Writer. Can I now import that template directly from Zoho Docs into my templates in Zoho CRM??
                                                                                                  • How do I connect a Google Cloud Project as a Custom Service

                                                                                                    How can I connect a Google Cloud project as a custom service to ZohoCRM? I need to pull YouTube Analytics data into CRM, but I cannot use the included YouTube service as it does not have the scopes I need. Therefore, I need to create a custom service.
                                                                                                  • Member Portal with Subscriptions

                                                                                                    We are a subscription box business using Zoho One.  How do our members login to make changes to their subscriptions, contact details, etc.  Is there a portal?  If not, what should we do to create one?  Also, we must be able to customize the portal with tabs and custom fields.  Finally, we need form and survey information to show up in the portal with some items editable and others read only.  I really need this information soon.  Thank you! Paige
                                                                                                  • How to select alternate invoice email notification template

                                                                                                    When we reissue an invoice, we want to send a different notification email. I am able to set up the alternate email body using Email Notifications/Invoice Notification settings, but I can't figure out how to attach that template to a specific invoice.
                                                                                                  • Telegram -> Zoho Creator answer via API.

                                                                                                    Hello! Did anyone work or established back connection from Telegram to Zoho Creator via API? I'm able to send notification from ZC to TG Bot successfully. (webhook is set) My notification consists of some information and inline buttons "yes" and "no".
                                                                                                  • How Can I Easily Access and Manage My GEPCO Online Bill Using Zoho Sheets?

                                                                                                    Hello everyone, I'm looking for an efficient way to access and manage my GEPCO online bills. I've heard that Zoho Sheets can be a powerful tool for organizing and tracking bills, but I'm not sure how to set it up for this specific purpose. Does anyone
                                                                                                  • Update a form record based on another form with same user ID

                                                                                                    Hi, I have 2 forms linked : Customer and Subscription When a customer fills-in a subsequent subscription form, there is a automatic subscription number created in the subscription form that I want to paste in a miroir field in the customer field. What
                                                                                                  • How to Initiate WhatsApp Message on SalesIQ?

                                                                                                    I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                                                                                  • How can I transfer data from Production to Development environment?

                                                                                                    Hi, I am using Creator V6 and would like to bring all the data in production to the Development and Testing environments? Is there an easy way of doing that or I have to export and import each table?
                                                                                                  • Issue Configuring SSO Integration with Cognito in Zoho Help Center

                                                                                                    Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
                                                                                                  • Custom Roles & Granular Permission Control in Zoho SalesIQ

                                                                                                    Hello Zoho SalesIQ Team, We appreciate the functionalities offered by Zoho SalesIQ, but we would like to request a crucial enhancement regarding user roles and permissions. Current Issue: At present, Zoho SalesIQ provides fixed roles—Admin, Supervisor,
                                                                                                  • Zoho Creator Upcoming Updates - October 2023

                                                                                                    Hello all! As we step into the final quarter of this year, we're ushering in a fresh wave of improvements and new features to supercharge your experience with Zoho Creator. Join us today as we present the newest updates and enhancements for this month:
                                                                                                  • Sales without an invoice

                                                                                                    Sales without an invoice is not included on the “payments received” report. Also, sales without an invoice is not listed in the transactions under the customer’s profile, also making it easy to do a double entry. Is there a way for me to see my sales
                                                                                                  • Rebrand your CRM with the all-new custom domain mapping setup

                                                                                                    UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
                                                                                                  • Nested Sub-forms (Subform within subform)

                                                                                                    Hi Team, Whether there is any possibilities to add sub-form with in another sub-form like Main Form       -> Sub form A             ->Sub form B If we tried this, only one level of sub form only working.  Any one having any idea about this? Thanks Selvamuthukumar R
                                                                                                  • Delay Function

                                                                                                    Hello, I would like to emphasize the importance of incorporating a delay functionality within custom functions, particularly in the context of integrating multiple platforms. As I understand, a delay function is not available by default in Zoho. However,
                                                                                                  • Next Page