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 

    • 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
    • Recent Topics

    • Change work hours per day for employees

      Hello, Is there a way to modify the work hours per day for employees in Zoho projects? This would be helpful for resource allocation to more accurately see when an employee who works 35 hours a week vs 40 hours has a full schedule. Thanks.
    • Zoho CRM Automation Help: Send Email When Fault is Marked as Done & Module Relationships

      Hi everyone, I have the following User-Created Modules in Zoho CRM: Clients Assets Faults Handymen Every client can have multiple assets. Every asset can have multiple faults. Every fault is assigned to one handyman. What I Want to Achieve: ✅ I want to
    • Adding New Domain to Zoho mail

      Hi, I have one Zoho account already called for example "Awesome Animals". Under this account I have one domain already setup with zoho mail, example: - awesomecats.com I have another website as well which I want to add under this "Awesome Animals" account,
    • I cannot receive emails.

      I need help, I've tried everything but I still can't receive emails from other people. I can send it but I can't receive emails, When I created the email it was all in order and suddenly I can't get emails from anyone anymore.
    • Incoming Gmail Email Not Coming Into Zoho

      My outbound email from Zoho is working, but when people respond to the email, it's not coming back into Zoho. I can see it when I'm in Gmail, but it's not in Zoho.
    • Não foi possível enviar a mensagem;Razão:554 5.1.8 Email Outgoing Blocked.

      Preciso de ajuda não consigo enviar emails,conta recen criada
    • 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.
    • Credit note

      By mistake I issued credit note in Jan 2025 for the invoice related to Dec 2024. Now I want to delete this credit note but anable to do so. Need help in this
    • 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?
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • Quais são os maiores desafios que você enfrenta ao implementar o Zoho CRM?

      Olá, pessoal da comunidade Zoho Brasil! Sou parceiro autorizado da Zoho e, ao longo do tempo, tenho notado que cada implementação de CRM traz desafios únicos, dependendo do segmento de negócio, das metas da empresa e até da familiaridade da equipe com
    • 2025 Just Got More Exciting for Developers!

      Hello, Greetings to the Zoho Books Community! As we step into the New Year, we're thrilled to roll out something truly special for our Zoho Finance enthusiasts – the "Zoho Finance Developer" Community! This is your exclusive space to connect with fellow
    • Error in executing On user input script

      I'm having problems with this  this script : ; Tipo_list=List(); Tipo_rec = Tabla_factores[Periodo == input.Periodo_anos.toLong()]; Tipo_list.addAll(Tipo_rec.Clase_credito.getall()); for each Clase_credito in Tipo_list { Tipo_credito:ui.add(Clase_credito) } Error in executing On User Input script of Periodo en años. Error. Error in executing Fetch Record task. Unable to fetch Tabla_factores and update variable Tipo_rec. Error in evaluating the criteria : Error. Error evaluating NUMERIC expression
    • sync data from outside of zoho plateform

      hii team , i am creating a platform using zoho platform, i want to sync the data from out side of the platform like people-soft, but i am not able to sync the data , if it is possible , then suggest me how can i do it , i want to sync data from other
    • How to add a Data Updated As Of: dynamically in text?

      I need to add a "Data Updated As Of" in the dashboard to show when was the last date the data was updated. I tried to create a widget but it does not look really good, see below. Is there a way I can do this through the text widget and update it automatically
    • Automate search in customer list and easilly initiate email

      Hello and happy new year ! I have a customer list with name, telephone, emails and some criterias like location, type of customer, etc. I want to search that form to extract part of it, for example all customers that have a location of "Québec city" and
    • "Select All" item in the context menu

      In the Client on Android, there is a “Select all” item in the note’s context menu. There is no such item in the PC client. Can it be added in future versions of the client?
    • Syncing Leave Calendar With Shared Google Calendar Does Not Remove Canceled Leaves

      Our organization has each employee sync their Leaves calendar with a shared Google calendar, but am I right that if an employee cancels a Leave in Zoho that it will not be removed automatically from the shared Google calendar through the same sync m
    • Next Page