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

      • All notes disappeared

        I've been using the notebook app for over five years on my phone without being logged into an account. A few days ago I opened the app and all my notes had disappeared. Since then I tried restarting my phone, updating the app and logging into my account,
      • Function 56: Automatically enable the option for customers to pay via bank account

        Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
      • Issues hosting Zoho Desk Web Form on SharePoint and/or Power BI

        Zoho Desk onboarding support has no experience with embedding their web form in either SharePoint or Power BI. Microsoft states that SharePoint and Power BI only support iframe HTML. And unfortunately, the web form embed code that Zoho generates is not
      • Standalone function is not working

        Hi, We have created a standalone function to integrate with a third-party service using OAuth. However, the standalone function's REST API key is expiring automatically after some time. When we regenerate the API key from the admin account, the function
      • Zoho Visual Editor Not Opening

        Hello There I am trying to build a website using zoho and I can't open the visual editor. It keep saying Loading...  Do you know why it is happening. Thanks in Advance Regards Rajat
      • Function went from fine to nonfunctioning without change

        url = "https://www.zohoapis.com/crm/v7/Accounts/" + id + "/Attachments/" + attach_id; file_engage = invokeurl [ url :url type :GET connection:"zoho_attachments" ]; The attach id is grabbed from a file upload field account = zoho.crm.getRecordById("Accounts",id);
      • Can I give access of my Zoho Spreadsheet?

        Hello Everbody! I work with a travel and tourism company, and my job is to record the data of clients of the company. And I use zoho for my work. So my question is can I give access of my sheet to the clients and my company. Kindly guide me. Thankyo
      • Syncing Fields Between Accounts AND Deals

        Please don't email me, I will check this thread for updates daily. I have a custom set of 10 fields (CFSET) in my account pages and deals pages. I want to fill them out on accounts pages per each, then when I make a new deal in an account, I want to copy
      • Domain verification is in progress... (How long do I need to wait?)

        Trying to setup my first email domain by connecting with GoDaddy. Have been here for quite some time and the screen is not changing. How long should this take?Send DataSend Data
      • This mobile number has been marked spam. Please contact support.

        Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
      • Unable to send message;Reason:553 Relaying disallowed. Invalid Domain

        Team, When i try to send mail through ZOHO mail i am getting the following error. "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain" Can i get some help on this. Thanks
      • Edit HTML of forms? Add autocomplete="off"?

        Recently I've noticed that something — one customer suggested it was Chrome — is auto-filling one of my form fields with the customer's address. The field is a textarea that has nothing to do with the address — it's just a comment field. I'd like to be
      • Zoho mail stopped receiving emails

        My Zoho email addresses that are linked to a domain suddenly stopped receiving messages yesterday, even though I've been using Zoho mail without problems for 1,5 years. I receive this reply to test emails: "553 Relaying disallowed". Due to this, my SMTP
      • Email client fails to connect to IMAP & POP EU Servers for ALL users

        For the last couple of days, all users on my account are failing to connect to the Zoho EU mails servers. This is using mobile app on various phones & desktop mail clients on different computers. Everything works fine when using webmail & email is still
      • Zoho Project API search?

        Good day, i would like to search our entire portal for a task using the API. We have over 20k tasks so I dont to search for all tasks and then do a for each as it would take way to long and also would need to go over the limit of 200 records per query.
      • My email client shows no emails anymore

        I let my account expire due to old payment method. I repurchased it I turned back on IMAP Then all my emails disapeared. Everything is fine in the webview and and zoho mail app
      • Invalid Domain

        Team, When i try to send mail through ZOHO mail i am getting the following error. "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain" Can i get some help on this. Thanks
      • URGENT - Issue with outgoing mail

        I am receiving mail but atm can not send - and not being given any code/reason as to why?
      • Impossible d'envoyer un message :Raison :553 Relaying disallowed. Invalid Domain - masertech.ma

        Bonjour, J'ai renouvelé mon abonnement mais j'ai le probleme de domain.
      • Email SPF Hard Fail

        Hi, can you help me to understand why email rejected? Paste error: This is the mail system at host pdx1-sub0-mail-mx206.dreamhost.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.
      • Can I export to PDF in Zoho Learn

        I have seen help pages where export to pdf options are available but I do not see that option available from the application. I see that exprt is available in my free trial version but that is only to html pages. I need to be able to export my manuals
      • COQL equivalent to zoho.crm.getRelatedRecords

        Hello i add a standalone function, that i call from my js app with ZOHO.CRM.CONNECTION.invoke etc in the function i fetch with something like this AllContacts = zoho.crm.getRelatedRecords("relation_name","parent_module_name",recordid); it works great
      • Add option "Avoid custom home pages" to profiles

        We need our sales agents and members on each department in general to keep the same Home designed by their Managers. Let all users to create custom home pages is a huge mistake. The homepage creation must be limited by profile so only Managers are allowed
      • why is zoho assist server so slow

        Hello why is zoho assist server so slow, i use it every and and have fast speed at either end of the connection but zoho assist take upto 10 seconds per click, I connect on the chat they we will have a look and come back saying they have done a reset
      • WHEN UPDATE ORGANIZATION INFO OLD INVOICES ALSO CHANGE INVOICING DATA

        Hi We have updated our tax information because we have become a company, up until now we were an individual. The problem is that when updating the data in the zoho books profile all the old invoices change their tax information as well. Is there a way
      • DELETE EU VAT ID FORM MY ACTUAL INVOICE ADDRESS FROM MY ACCOUNT

        WE NEED TO DELETE (NOT CHANGE) THE EU VAT ID FROM OUR INVOICE ADDRESS. WHEN WE TRY TO LEFT IT BLANNK, AGAIN SAVE THE OLD EU VAT ID. YOU ARE SENDING US FALSE INVOICES WITH FALSE DATA
      • Enable Timesheet for Client Users

        In Zoho Projects, the client users can log work hours in timesheets and track the time spent on tasks and issues. This permission can be enabled only by the portal owner or the admin. For instance, If the administrator wants a client user to add the time
      • Possible to delete the "Big Deal Alert" in Zoho CRM?

        Hi, Is it possible to delete the "Big Deal Alert" in Zoho CRM? My company has no need for it and I want to remove it to clean up my email templates list. Thank you.
      • How to Create and Edit Advances in Zoho Expense Using Deluge?

        Hi everyone, I am working with Zoho Expense and need to manage Advances (Advance Payments) using Deluge. I’ve familiarized myself with some basic functions, but I have specific questions about how to create and edit advance records: Creating Advances:
      • ¿Cómo publicar mi pagina web zoho?

        Arme una pagina web en zoho, al querer publicarla seguí los pasos y pulse en publicar, pero no se publico. Ya pasaron 2 días. podían ayudarme.
      • What's New in Zoho Analytics - December 2024

        Hello Users! We’re excited to bring you a roundup of the latest features and improvements in Zoho Analytics. These updates are designed to elevate your data analytics experience, making it more powerful, interactive, and seamless. Let’s dive in! Expanded
      • Setting default From address when replying to request

        At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com.  The first two are really internal address that should never be seen by the customer and
      • Zoho Sheet View

        Hello, Is there a way to either customize the columns that appear in Zoho Sheet View, or else show all columns?
      • For security reasons your account has been blocked as you have exceeded the maximum number of requests per minute that can originate from one account.

        Hello Zoho Even if we open 10-15 windows in still we are getting our accounts locked with error " For security reasons your account has been blocked as you have exceeded the maximum number of requests per minute that can originate from one account. "
      • Sharing sheet without affecting original spreadsheet

        I want to share a sheet using a password unique to the end user who will be able to enter data that will help them make a decision. I don't want or need any changes to show up to original file inside my Zoho account. I will be sharing this sheet over
      • How do you re-order (sort) the order of articles in a chapter?

        So you can re-order Chapters but I cannot see where and how to re-order the Articles within each Chapter... Surely this is possible?
      • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

        We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
      • How do I delete survey responses (Customer Happiness)

        Hi,  I need to remove dummy survey responses (those I created during evaluation period), and invalid ones - responses received from Cancelled tickets - which is a custom status we use to close spam, duplicate, or internal emails. I cannot find anywhere to remove them, and one of your chat agents suggested to remove the response provider (contact).  I'm not inclined to do what was suggested as there could be valid responses from that contact, so kindly provide another option. And I did try that too
      • Simplify Zoho API integration with Deluge’s invokeAPI task

        Hello all! Happy New Year! As we kick off 2025, we’re excited to share some of the latest updates to enhance your Deluge experience. While Deluge already offered robust API integration capabilities, we’ve taken it to the next level with the introduction
      • Trigger an action when a Product item is added to the Deal's Product Related List section?

        Hello, Is it possible, via workdlow, to trigger an action when a Product is added to the Deal's Related List section? Thank you
      • Next Page