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




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        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
                                                • Ask the Experts 10: A 5-hour online Q&A on Zoho Desk Best Practices

                                                  Welcome to Zoho Desk's Ask the Experts session! This is a monthly discussion on our  forums; wherein a panel of experts will take on questions  specific to topics related to Zoho Desk. The panel will be available for a 5-hour period and will answer any questions posted here.   Let's begin the year learning some best practices from our experts. In this month's ATE we are opening the floor to questions on how to use Zoho Desk the best way.  If you have a business use case but not sure if Workflow is
                                                • 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. 
                                                • Ask the Experts 7: A 5-hour online Q&A on Telephony and Call Module

                                                  Welcome to Ask the Experts session! This is a monthly discussion in forums; each session, a panel of experts will take questions on specific topics related to Zoho Desk. The panel will be available for a 5-hour period and answer any questions posted here. In this month's Ask the Experts, we will take questions on everything related to Telephony and the Call Module in Zoho Desk. We will discuss the following aspects:  Integration with different Telephony vendors Routing calls to agents Converting


                                                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 Campaigns 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

                                                                                                  • Expand Zia's Language Support and AI Capabilities

                                                                                                    Dear Zoho Desk Support, I would like to submit a feature request to improve Zia, the AI-driven support assistant in Zoho Desk. Currently, Zia only supports the English language, while other AI agents such as Gemini, ChatGPT, and Claude can work with a
                                                                                                  • Average Costing / Weighted Average Costing

                                                                                                    Hello fellow maadirs. I understand Zoho Books uses FIFO method of dealing with inventory costing, but do you guys have any plans to introduce average costing? We indians need average costing. It's part of our culture. Please. I beg thee. Thanks.
                                                                                                  • Links in Instagram

                                                                                                    Hi there, I have been using Later for a while now but keen to come back to Zoho Social as Later doesn't offer tagging of pages on Facebook but they offer something Zoho doesn't. You can add a link to your bio which opens up your profile feed where images
                                                                                                  • Zoho Social integration with Zoho Flow

                                                                                                    Is there any plans for Zoho Social integration with Zoho Flow?
                                                                                                  • Adding tag to specific record as an acion in a workflow

                                                                                                    Hi! I've created the following workflow in the module 'Leads'. When a record meets the criteria, there should be a tag added to the specific record in the module 'Contacts'. In the module 'Leads', there is a look-up field named 'Kandidaat' which is connected
                                                                                                  • How to query for Deals record based on Pipeline?

                                                                                                    I want to query for Deals records that matches a specified Pipeline using a Deluge function. When I call zoho.crm.searchRecords("Deals","(Pipeline:equals:" + myPipeline + ")"), I get this error: { code: 'INVALID_QUERY' , details: {...} , message: 'Invalid
                                                                                                  • CRM formula field help

                                                                                                    Hello! i was hoping to get some help with a formula i'm creating within a module. I'm looking to make a formula that changes based on a date field but based upon the present date. This is the formula i have so far: If(Now() < ${Instructors.Start Date},
                                                                                                  • Change to copy/paste functionality in Deluge code editor

                                                                                                    Recently there was a change to the Deluge code etidor where it now inserts backslashes into strings automatically when copying/pasting strings with double quotes, it's a nightmare to have to go delete all these. Is it possible to toggle this on or off?
                                                                                                  • ChatGPT only summarize in English

                                                                                                    Hello i' v enabled chatgpt in salesIQ, it works great inside conversation (revise, Rephrase etc) add tags works well with another language than English. But when I want to summarize it render only in English, despite sales IQ is set to another language.
                                                                                                  • Chart with Filtered Data vs Unfiltered Data

                                                                                                    I am looking to create a chart view that displays the full data set vs a subset of the data filtered by user filter. However I do not seem to find any method by which to exclude a plot from the applied filter or any other method by which to display the
                                                                                                  • BIN Locations

                                                                                                    Hi, I’m new to Zoho inventory and unless Im missing something, I cannot find BIN locations anywhere in ‘items’? please tell me it’s there somewhere?!? Thanks
                                                                                                  • Can't verify domain with AWS Route53

                                                                                                    I have a domain successfully transferred to AWS Route53 from NameCheap. When I try to CNAME or TXT Records as suggested, they are added in AWS console however zohomail does not verify them.  For the TXT record zohomail says the value is wrong, whereas for CNAME record zohomail can't find any CNAME record. I don't know what to do! 
                                                                                                  • BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING

                                                                                                    As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
                                                                                                  • Create a custom button to modify custom fields in zoho Inventory

                                                                                                    I am needing a script for two buttons, 1. Button will add todays date to a custom field named cf_sent_to_sov 2. Button will mark a checkbox or unmark a checkbox field named cf_parts_ordered I have been trying to figure out deluge but have not got anywhere
                                                                                                  • Canadian payroll

                                                                                                    Hello ZOHO, is any updates on when payroll for Canada will be available?
                                                                                                  • Default reminders on Emails

                                                                                                    I have seen that it is possible to set, for each email, a reminder when the email remains unresponded for some time. This is very useful, so useful that I would like to set it for all my emails, by default. Because an unanswered email usually requires
                                                                                                  • Update Department on Ticket (with applied Blueprint)

                                                                                                    Hello, Is it possible to update the Department of a ticket which is dictated by a blueprint, e.g. I would like to change departments at different states in the Blueprint. I do not see this is an option in workflow rules or blueprint transition actions,
                                                                                                  • in zoho assist I would like to temporarliy go into view only mode

                                                                                                    During a zoho assist remote support / remote control session, I would like an option to turn off control, and go into view only mode. Then later, turn back on control, all within the same session. (Many other remote login apps have this feature.) For
                                                                                                  • 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
                                                                                                  • QR code image is not exported in PDFs

                                                                                                    The new QR code field works fine when I include it in a report template and I choose the print option: https://creatorapp.zoho.com/<username>/<app_link_name>/record-print/<report_link_name>/<record_ID>/ But when I try to save the document to a .pdf file
                                                                                                  • Zoho notes list issue

                                                                                                    Hi team, Suddenly my extension is not working and I could not find the extension in my marketplace list anymore. Extension version deprecated This version of the extension is no longer in use. Please update the extension and try again.
                                                                                                  • Assignment Rule: Immediate Ticket Assignment to Agents Upon Shift Start

                                                                                                    Dear Zoho Desk Team, I hope this message finds you well. Currently, when the option to assign tickets to offline agents is turned off, agents who come online during their shift have to wait for about 30 minutes before any tickets from the queue are assigned
                                                                                                  • Change email template depending on answer from form

                                                                                                    Is it possible to set up the following in Zoho Desk: When a user submits a ticket via the Zoho Help Center's form, they can select an answer from a dropdown field. In this example, the dropdown options are 'Option A' and 'Option B.' If a user selects
                                                                                                  • Kaizen #171: FAQs on COQL API

                                                                                                    Hello all!! Welcome back to another post in the Kaizen series! In this post, we will address some of the most frequently asked questions about Zoho CRM's COQL API from the Zoho CRM Developer Community Forum. COQL API Query API lets you query for records
                                                                                                  • Issue with Date Placeholder Formatting in Ticket ID Customization

                                                                                                    Hello Support Team, I'm experiencing an issue with the date placeholder formatting in Zoho Desk's Ticket ID customization. Specifically, when using the `{{DD}}` placeholder for the day in the prefix or suffix, the output displays the day as a single digit
                                                                                                  • Time Field

                                                                                                    Good Day, I have a question, when I save a draft and reload it. Why does the time field format keeps goes from hh:mm to hh:mm:ss? Is there a way I can force it to load to hh:mm only? I have tried example = totime(input.TimeField, "hh:mm") in the -created
                                                                                                  • Zoho CRM Widget and translations

                                                                                                    Hi everyone! We're building a Widget with zoho-extension-toolkit, how is localization supposed to work? "zet init" created a translations/en.json file, but what should go inside it and how is it supposed to be accessed from the Widget/javascript? Thanks
                                                                                                  • Feature Req - See imap emails in Timeline tab of a deal

                                                                                                    In many other CRMs such as pipedrive and hubspot, when you are looking at the timeline of a deal you can also see snippets of emails that have been sent or received and then click to view the full message. This gives users a fast way to catch up on EVERYTHING
                                                                                                  • HOW TO: Searching a thread (email body/text) with a custom function, allowing filtering and specific actions

                                                                                                    We are still trialing out Zoho at this time, but have found a major expected feature to be missing - the ability to search within the text of an email for automation/workflows. NOTE: You need to create a connection for zohodesk under settings -> Developer
                                                                                                  • Partnership Proposal for Supporting Number Porting Services in Singapore

                                                                                                    Dear Zoho Representative’s, I hope this message finds you well. My name is Honelito Gilos, and I represent Borderless Hub Pte Ltd (Singapore). We are a Telco here in Singapore specialising in providing seamless number porting services, and I’m reaching
                                                                                                  • Tip #2: Prefill forms automatically with existing Zoho CRM data

                                                                                                    How to automatically prefill a form with existing Zoho CRM data? Prefilled forms can be useful when you want your prospects to view and confirm their data, and in a wide range of other situations. In Zoho Forms, we prefill the fields with the values from Zoho CRM using the Zoho CRM field. What is a Zoho CRM field? A Zoho CRM field acts as a two-way communication channel, by sending data to Zoho CRM from forms and fetching information from CRM into Forms. The field will look up data from your CRM
                                                                                                  • Pushing GCLID info from Gravity Forms to ZohoCRM

                                                                                                    We are switching to Gravity Forms from Zoho Forms and I cannot find any good info on how to make sure my GCLID tracking info is pushed through to the CRM through my new forms. There was an article in the documentation about placing something within the
                                                                                                  • Organization Variables - Restrict Access

                                                                                                    Currently, there is no way to restrict the access to organization variables. This leads to a problem when storing API related values that should be kept secret as anyone with access to create and edit email templates, workflow rules, or inventory templates
                                                                                                  • Massive price increase for user licenses of Zoho Portal

                                                                                                    This actually a complaint about this announcement: https://help.zoho.com/portal/en/community/topic/free-user-licenses-across-all-portal-user-types You present this as an enhancement. And, yes, while reading the main part, I'd agree that (for smaller companies),
                                                                                                  • Transform Your Customer Support with AI-Powered Chatbots in Zoho SalesIQ

                                                                                                    Ever wondered how some companies seem to have superhuman customer support? Let's uncover their secret! In the digital age, customer expectations are skyrocketing. Did you know that according to McKinsey, 75% of consumers expect a response within five
                                                                                                  • Quickbooks conversion and Internet sales

                                                                                                    Hello, we are considering converting from Quickbooks enterprise to Zoho Books and using MonotorZ for our mrp needs. Today we import Internet sales under a single customer with multiple ship to addresses. We want to maintain the detail in CRM for marketing
                                                                                                  • KPI widget with percentage

                                                                                                    I'm trying to create a KPM widget that displays current performance as a percentage - something like the picture below. I've tried following the instructions at https://www.zoho.com/analytics/help/dashboard/kpi-widgets.html#chart but nothing ends up being
                                                                                                  • How to add two columns in Zoho forms

                                                                                                    I would like to have two columns in Zoho forms. How can i enable two columns?
                                                                                                  • When creating Sales Order / Estimate via API, the line item Tax Code does not get pulled in.

                                                                                                    I'm creating Sales Orders via API from CRM but it does not pull in the "Tax Code" I've read within the forums that this should be done automatically but it's not happening. Not sure if it's a bug or by design? Anybody else know? Should we be adding the
                                                                                                  • Chart showing schedule

                                                                                                    I want to be able to create a chart for everyday to check and which of which driver is available on the timeframe. Here's my table Name City Day Start Time End Time Driver1 Medicine Hat Monday 11:45 AM 4:45 PM Driver 2 Medicine Hat Tuesday 11:00 AM 7:00
                                                                                                  • Next Page