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

    • 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
    • Auto-Create OneDrive Folder Structure Upon Lead Creation

      Hello, New to Zoho and looking for help on a critical process automation I'm looking to implement. My company currently utilizes OneDrive for file management and the folder structure is Proposals -> Client Name -> Address (where I need to initially create
    • 🔍 How to effectively organize data in a CRM? – My approach and questions for you

      Dear ZOHOssians! While working on organizing data in a CRM, I decided to use the native modules: Leads, Deals, Contacts, and Accounts as a solid foundation for managing processes. However, I’m now exploring the next steps and considering various options
    • Stock Count

      The stock count is a nice new feature, but we cannot figure out how to: 1. Use it without assigning to a person, we have a team or one of multiple do stock counts as do most any company. 2. Add any extra fields to what the "counter" sees. The most important
    • Annoying Pop-Up Zoho Advertisements and Announcements Within Apps

      It is beyond frustrating to have to close out Zoho's announcements for Webinars, Zoholics, updates, events, etc while working within ANY of the Zoho apps. I see it when accessing Zoho One, Cliq, Creator, and CRM. Zoho boasts to be a professional solution
    • Images uploaded onto text notes through the mobile app won't render

      When uploading am image onto a text note, exiting the note and going back in, the image is gone and shows an error icon in its place, and also won't display directly on other devices, including on the desktop version. Uploading the same image on the same
    • Marking a Desk ticket as Unread after merge

      We have a custom script that runs against every new ticket and auto-merges it with any existing ticket that matches our criteria. That works fine but there is no functionality that reverts the newly-updated ticket back to an "unread" state. I found the
    • Trying to do commission tracking with zoho crm, can i do a Lookup against multiple fields in a module?

      So i'm still designing my zoho one crm as i come over from salesforce. One of the things i'm trying to build is a commission tracking module. At some point i'll probably hire someone to help with custom code, I'm just proof of concepting it. I"m not sure
    • Internal Support and Assigning Tickets

      I want to set up an Internal Desk Support system. Here is what I need... We need our internal "Support" staff to be the Ticket Owner We need to be able to identify who the "Account Manager" is on that client and get emails as part of the ticket. I'd like
    • Filter a Zoho Creator main report by a field and display other related reports in sections on a Zoho Creator page

      Hi, How can I filter a Zoho Creator main report by a field and display other related reports in sections on a Zoho Creator page? Part of what I was given below is setting up sub-reports, but the subform field prompted me to link a form, not a report.
    • FAQs on Approval Process - Post your Questions

      Dear All, Greetings! Approval process allows to validate records and streamline the process across organization to ensure a systematic approach. To resolve your probable queries, we are constantly gathering relevant FAQs and publishing them to address
    • 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
    • Introducing Social Toolkit

      Hi everyone, We're thrilled to launch Social Toolkit, a one-stop dashboard to help take your social media presence to new levels by letting you create aesthetic profiles and share content that your audience will actually enjoy engaging with. Social Toolkit
    • Requesting a file upload in Zoho Workplace not possible?

      I’m new to Zoho Workplace and am mostly liking it. However, it seems as though collecting/requesting documents is not available in the workplace version of WorkDrive. Am I missing something, or would I need to subscribe separately to another WorkDrive
    • Poor Email Delivery

      Our company used Zoho about 2 years ago and always had trouble understanding why a great deal of our emails from Zoho CRM and Zoho Marketing Automation ended up in the recipient's spam folder regardless of the email content and despite having our domain
    • No table view in "All departmens" mode

      Hello, I would like to have an overview of all tickets, so I have to switch to "all departments". But here I don't have the possibility to activate the table view. But this is mandatory, so that I can see certain fields without having to open each ticket
    • Where to Map Candidate fields to Employee fields in Zoho People 5.0

      I can not find options anywhere on Zoho people 5.0 where I can choose how the data fields are mapped from the candidate form to the onboarding form
    • Get Creator Form Record ID and Subform ID's

      Good Afternoon everyone. I have a Creator form with a on success workflow. I'm trying to get the form record ID and the subform record ID(s) but they keep coming up null. There is data in the subform I use it elsewhere. Can anyone help me pull the ID's.
    • WhatsApp and Zoho Creator Integration

      How we have integrate WhatsApp App with Zoho Creator without using external application ?
    • Guidance on Making Zoho Desk Connections Available for All Data Centers

      Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
    • Can we create Sprint with tasks from Multiple projects?

      Hi Team, We were using Zoho Sprints for quite sometime. Currently we have started the process of Sprint method. We couldnt create the active sprint board with the tasks from multiple projects. I would like to know whether this is possible or Any timeline
    • Ability to use Dynamic goals in Motivator

      Is there any way to create dynamic goals in Zoho Motivator? By "dynamic" I mean: not the same target every period, but varying from period to period. For example, in our organization, sales reps are supposed to target beating the same month's sales last
    • Using Snippets in Comments

      One of our Agents asked about using snippets in comments. We don't see this as an option at this time, only in reply mode. Is there a way to enable this?
    • Calendar - "super compact" week view

      every time i go to my calendar i have to re-engage the "super-compact view" for the week view...is there a way to make "super-compact" a default view so I dont have to keep on setting it manually?
    • zoho calendar week view - "super compact by default"

      every time i go to my calendar i have to re-engage the "super-compact view" for the week view...is there a way to make "super-compact" a default view so I dont have to keep on setting it manually?
    • CRM portal: no Create/Edit options available for custom module

      I'm experimenting with setting up a CRM portal. I'm not able to select Create and Edit permissions for a custom module, even though the data sharing settings for this module has been set to Public Read/Write/Delete. What other settings do I need to enable
    • Which are the IP addresses to use for 'split delivery' with Office 365? (Zoho mail inbound gateway)

      Hi, I'm trying to set up 'split delivery' (email routing) with Office 365. I'm following the instructions to set up Office 365 as the primary server (https://www.zoho.com/mail/help/adminconsole/coexistence-with-office365.html) One of the prerequisites
    • Allow submitter to type a choice in a 'Multiple Choice' field

      Is there any way to allow the person filling out a form to manually type in a choice in the 'Multiple Choice' field? So like have the option of allowing the last field to be 'Other' with an input field...
    • How to Add Portal Users in Zoho Creator's Development Environment for Testing?

      Hello, I’m working on a Creator app with a customer portal and implementing filters based on the logged-in user (customer). To test these filter functions, I'd like to simulate or add customer portal users in the development environment/database. Is there
    • Mapping a custom picklist to another picklist when creating a connected record with a workflow

      Hi, I have some workflows that move records between pipelines, the issue is that when setting up the workflow that creates the connected record, there is no option to map the value from a picklist in one pipeline to another. Please watch: https://www.loom.com/share/4e5fa969b21043748414154c036cdd47?sid=dca0fd16-73f2-4fe6-a9d3-7a4c0c40c2e6
    • Initiate data import using Deluge script

      Is it possible to open the screen to begin the importing of new records using Deluge? So for example, my users would click a button on a form that starts a workflow action. This action would then open the screen to "Import Data for Current User Projects".
    • Whats App Automation

      It would be nice to be able to send out an automated whats app message template on moving stages or creation of a ticket (same as you can do for automated emails). Currently only automated emails can be sent. Also, if whats app could be used more effectively
    • Unable to add organization consultants and contractors in Zoho People

      Hello Team: I am unable to add my few consultants and contractors in Zoho People. How to add these people as Users?
    • Lookup field - Can I avoid using advanced search?

      I have a lookup field in my app that has surpassed 500,000 records, now basic search is disabled and I'm forced to use advanced search. That adds multiple steps to what used to be very simple. Before: Select field > Type last digits of product code and
    • Forced Tooltip on Maps View

      Please remove the forced tool tip data points and ONLY include those listed in the "Include Columns for Tooltip" area. Also, disable the tool tip if no fields in there. With a lat/lng map, it forces showing those (and color field, lat count) and will
    • Last sync date/time as a widget

      Is there any way to get the last date/time that the data shown (reports and dashboard) was last updated. For example, If I have our data being synced every 3 hours and the last was done 2 hrs ago, I would like to show date/time of update OR updated #{hrs}
    • Function #19: Associate invoice templates automatically based on branch

      Much like the custom function we shared last week, today's function also aims to facilitate the automatic association of invoice templates. When you're managing business operations across various branches, there may be a need to create and send invoices
    • how to create view in leads module to that will show all leads + converted leads?

      is it possible to make custom view that combine all leads + converted leads? how to do that
    • Milestone

      New to Zoho and trying to get acquainted. According to PMI a milestone "anticipates what the project is supposed to achieve at a pre-set date. It should describe a desired state of affairs, a desired future situation. There are two important aspects to this. First, the concept refers to a point in time, not a period of time. Second, it looks forward to what we want to create, not how we create it." Why are Zoho milestones defined between two dates and as bins for tasks? Why would you even consider
    • How to send mail with js SDK

      Hell o I'm using https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js, for my widget in CRM (built with sigma) Is it possible to send email from js file, I try ti use that ZOHO.CRM.API.sendMail({ "Entity": "Accounts", "RecordID": sharedVariableEntityId,
    • Next Page