Automation#21: Track Ticket Transfers Across Departments

Automation#21: Track Ticket Transfers Across Departments


Hello Everyone!
With Halloween just around the corner, we'd like to let you know the Zoho Desk team is always there to sweep away your customer service troubles!
This week, we’re excited to introduce a custom function that tracks tickets moved between departments.
While Zoho Desk has simplified customer service, keeping your support team stress-free and your customers happy often requires thoughtful adjustments. Zylker Techfix found a great solution with this feature. They handle services for different gadget types under specific departments, but sometimes tickets accidentally end up in the wrong department. Agents moved them to the correct one, but needed a way to track these transfers. By using the Time Entry feature and a custom function, they generated reports of all moved tickets effortlessly.

Here’s the custom function that utilizes the Time Entry feature to track tickets transferred between departments.
Prerequisites
1. Create Custom Fields
To track tickets moved from one Department (call it Dep A) to the other Department (call it Dep B) or vice versa, 
1.1 Go to Setup (S) >> Customization >> Layouts and Fields. Select Time Entry under Layouts and the Department (let's say Dep B) to which you would like to move the ticket. 
1.2 Create three custom single line fields in the Time Entry layout of the respective department (Dep B) . Click on the layout, 
1.2.1 Add a single line field with a label From department.
1.2.2 Add another single line field with a label To Department.
1.2.3  Add the third single line field with the label Agent Name.
1.3 Note the API names for the the single line fields to insert into the custom function. 
To find the API name, Click on the Gear wheel icon of the single line field. Click on Edit Properties, you will find the API Name under the Edit Field. Refer to Create Custom Fields
NotesIf you would like move the ticket from Dep B to Dep A, create the similar fields in the time entry layout for Dep A.
2. Create a connection
      2.1 Go to Setup(S) and choose Connections under Developer Space.
      2.2 Click Create Connection.
      2.3 Select Zoho OAuth under Default Connection.
      2.4 Set the connection name as ticket_time_entry_add.
      2.5 Under Scope, choose the below scope values:
             Desk.tickets.READ
             Desk.tickets.UPDATE
      2.6 Click Create and Connect.
      2.7 Click Connect and click Accept.
Connection is created successfully.

Create a Workflow Rule
1. Go to Setup(S), choose Workflows under Automation
2. In Workflow Rules, select the Department (Dep B) to which you want to move the tickets. 
3. Under Workflows, click Rules >> Create Rule.
In the Basic Information section,
4. Select Tickets from the drop-down menu under Module.
5. Enter a Rule Name and Description for the rule.
6. If you want to activate the rule right away, select the Active checkbox. Else, create the rule and activate it later.
7. Click Next.
In the Execute on section, follow these steps:
8. Select Create.  
9. Click Next.
10. Leave the Criteria section blank and click Next. 
11. 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 Input -------------
  2. fromDepartmentFieldAPIName = "cf_from_department";
  3. toDepartmentFieldAPIName = "cf_to_department";
  4. agentAPIName = "cf_agent_name";
  5. //----------- Configuration ------------------
  6. logs = Collection();
  7. timeEntryParam = Map();
  8. cf = Map();
  9. historyParam = Map();
  10. historyParam.put("from",0);
  11. historyParam.put("limit",1);
  12. historyParam.put("fieldName","departmentId");
  13. ticketHistory = invokeurl
  14. [
  15. url :deskURL + "/api/v1/tickets/" + ticketId + "/History"
  16. type :GET
  17. parameters:historyParam
  18. connection:"ticket_time_entry_add"
  19. ];
  20. logs.insert("ticketHistory":ticketHistory);
  21. if(ticketHistory != null && ticketHistory.get("data") != null)
  22. {
  23. historyDetails = ticketHistory.get("data").get("0");
  24. logs.insert("historyDetails":historyDetails);
  25. if(historyDetails.get("eventName") == "TicketUpdated" && historyDetails.get("eventInfo").get(0).get("propertyName") == "Department")
  26. {
  27.   departmentDetailsChanges = historyDetails.get("eventInfo").get("0").get("propertyValue");
  28.   previousDepartment = departmentDetailsChanges.get("previousValue").get("name");
  29.   currentDepartment = departmentDetailsChanges.get("updatedValue").get("name");
  30.   agent = historyDetails.get("actor").get("name");
  31.   departmentChangedTime = historyDetails.get("eventTime");
  32.   cf.put(fromDepartmentFieldAPIName,previousDepartment);
  33.   cf.put(toDepartmentFieldAPIName,currentDepartment);
  34.   cf.put(agentAPIName,agent);
  35.   timeEntryParam.put("executedTime",departmentChangedTime);
  36.   timeEntryParam.put("cf",cf);
  37.   logs.insert("timeEntryParam":timeEntryParam);
  38.   createTimeEntry = invokeurl
  39.   [
  40.   url :deskURL + "/api/v1/tickets/" + ticketId + "/timeEntry"
  41.   type :POST
  42.   parameters:timeEntryParam.toString()
  43.   connection:"ticket_time_entry_add"
  44.   ];
  45.   logs.insert("createTimeEntry":createTimeEntry);
  46. }
  47. }
  48. info logs;
Notes
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 3, add the API name of the From Department created in the Time Entry Layout.
c. In Line 4, add the API name of the To Department created in the Time Entry Layout.
d. In Line 5, add the API name of the Agent Name created in the Time Entry Layout.
14. Click Edit Arguments and include the argument mapping as below: 
       14.1 In the Name field, type ticketId and from the Value drop-down list, select Ticket Id under the Tickets Section.
15. Click Save to save the custom function.
16. Click Save again to save the workflow.
Notes
If you would like to move the ticket from Dep B to Dep A, create  the workflow rule in Dep A as well. 
Creating Ticket Tracking Reports
To track the ticket moved from one department, you can generate Reports under Analytics. 
Go to the Analytics module >> Choose Reports >> Add Report >> Select Tickets module and Time Entry under Related modules. Refer to Create Custom Report.
This custom function will help you keep an eye on your ticket movements, ensuring that none of your important tickets go missing!
Wishing you a delightful Halloween filled with joy and treats, along with a wonderful fall season! 🎃🍂
Until next week,
Warm regards,
Lydia Kiruba | 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

    • Deluge script to add Mail Task

      Has anyone out there created a custom function to create a Zoho Mail task? I'd be interested in hearing how you accomplished it. Sample code is appreciated!
    • Tags with Zapier

      Maybe I'm missing something....I hope so... Using tags for triggers is a key need.  This prevents us from having a ton of different lists. I am trying to find out how to add a tag using zapier when someone makes a purchase....but it doesn't seem to be
    • This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details

      Hello, Just signed up to ZOHO on a friend's recommendation. Got the TXT part (verified my domain), but whenever I try to add ANY user, I get the error: This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details I have emailed as well and writing here as well because when I searched, I saw many people faced the same issue and instead of email, they got a faster response here. My domain is: raisingreaderspk . com Hope this can be resolved.  Thank you
    • Send Supervisor Rule Emails Within Ticket Context in Zoho Desk

      Dear Zoho Desk Team, I hope this message finds you well. Currently, emails sent via Supervisor Rules in Zoho Desk are sent outside of the ticket context. As a result, if a client replies to such emails, their response creates a new ticket instead of appending
    • How to apply blueprint on tickets that created from IM module

      Hello, I have an issue applying blueprint on tickets that created from WhatsApp conversation, the tickets matches with the blueprint criteria but still we are not able to put these tickets into the blueprint. I've tried with deferent type of tickets and
    • Function #4: Schedule Customer Statements

      Regularly sending statements to customers is an imperative part of many business processes as it helps foster strong customer relationships and provides timely guidance on payments. While you can generate the statement of accounts and have it sent over
    • trying to access CRM Variables with JS SDK

      Hello i built a widget with Sigma, i create CRM VARIABLES in custom properties. I try to access them in function : ZOHO.embeddedApp.on("PageLoad",function(data) with : ZOHO.CRM.CONFIG.getVariable("mycrmvariable").then(function(data){ console.log("mycrmvariable
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Remove 30-Day Client Reply Restriction on Supervisor Rules in Zoho Desk

      Dear Zoho Desk Team, I hope you're doing well. Currently, Supervisor Rules in Zoho Desk run once every hour but only apply to tickets that have received a customer response within the past 30 days. This restriction creates challenges for us, as we have
    • Paid Support Plans with Automated Billing

      We (like many others, I'm sure) are designing or have paid support plans. Our design involves a given number of support hours in each plan. Here are my questions: 1) Are there any plans to add time-based plans in the Zoho Desk Support Plans feature? The
    • Contacts Don't Always Populate

      I've noticed that some contacts can easily be added to an email when I type their name. Other times, a contact doesn't appear even though I KNOW it is in my contact list. It is possible the ones I loaded from a spreadsheet are not an issue and the ones
    • How to get NSE/BSE Stock Prices in Zoho sheets?

      I've been looking for a function that provides me with the NSE/BSE listed stocks price in Zoho Sheets like GOOGLEFINANCE in Google sheets, but I found none. Please help if there is any way to het stock prices?
    • 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.
    • Tip #5: Setting access rights at the subfolder level

      Hello everyone, We hope you're finding our WorkDrive Tips and Tricks series useful. For today's tip, we'll teach you how to assign higher subfolder permissions to Team Folder members. Team Folders helps you avoid the drawbacks of traditional file sharing.
    • Cannot edit email text in Zoho Form rules

      I have a number of rules set up on a form depending on a user's submission. For some reason, I am no longer able to edit the content of the emails sent out based on those rules. I am invited to "use the advanced editor", but the original text of the email
    • Re-emitir facturas con nueva dirección de facturación

      Hola, necesito saber si es posible que las facturas ya emitidas, pueden ser re-emitidas con el cambio de dirección de facturación, realizado el día de hoy 02-01-2025, para efectos contables. Espero su ayuda, Gracias
    • Add "Lead Image" in Bulk?

      Each of our Leads is accompanied with a URL containing a photo of the lead when they come in. We currently have to manually download then upload the photo to the lead. This is a HUGE waste of time. Is there any way to AUTOMATICALLY add the photos to the
    • Client script: Can not choose a date field for an onChange field event

      Hi Zoho Team Why can't I choose one of my date fields to trigger an onChange event? Is this a client script limitation, or something wrong with my instance? If it is a limitation, is this mentioned in the documentation anywhere? Thanks. Marcus
    • Can multiple agents be assigned to one ticket on purpose?

      Is it possible to assign one ticket to two or more agents at a time? I would like the option to have multiple people working on one ticket so that the same ticket is viewable for those agents on their list of pending tickets. Is something like this currently
    • 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. "
    • how can I hide this Module?

      Hi everyone, newbie question. how can I hide the "Sales Order" column? when I try I get this message: https://imghostr.com/86395c_p7j
    • UI Arabic

      can i change the member portal UI to arabic in zoho community?
    • 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
    • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

      Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
    • How to display profile picture for distribution list?

      I am Admin of a Zoho Mail server and we have distribution lists along with user accounts. I am able to set Profile picture for the users and it shows when the email is sent to another companies. The members of the groups can also send email from those
    • Mail Search Not Working

      Hello, Mail search is not working at all. I've tried Chrome and Mozilla. I can try and search for an exact term, or even an email that is 1st in my email list. All search does is sit and spin, or it comes up with no results. I've also tried it on my android
    • Password should not contain sequential characters

      How can I avoid this? How do I even disable it. On my password policy page, it's all blank, so I don't know why I'm even getting this error now.
    • Same phone number for more than one account.

      Hi there, I am a webdeveloper specialising in providing websites, webhosting and email solutions for my customers. I have signed up a number of my customers to Zoho Mail in the past, and a couple of these have grown into a paid package for Zoho CRM. As
    • Is there a live chat for Zoho mail?

      I am having a problem in Zoho mail and would love to live chat with someone instead of email and wait for a response. Is there a function for this? I know there is in CRM but I can't seem to find it in mail... Thank you!
    • Integrating Zoho Desk Instances from two separate organizations

      Is it possible to integrate Zoho Desk with an instance from another organization? For example, creating a ticket in one organization can cause the creation of a ticket in the second organization? Or certain tickets from one organization be viewable by
    • Why does incoming mail inconsistently bounce back from Zoho mail

      On testing our user accounts, we are having problems where mail sent to zoho mail bounces back with errors message that 'relay access denied'. On testing from various accounts (including outlook, gmail and yahoo) mail seems to get through on some occasions
    • Zoho email setup in office365

      When i am trying to setup zoho mail setup using my domain in office365 and it is not working and it says that we couldn't log on to the incoming (IMAP) server and please check your email address and password and try again. I was able to login using my
    • JunkMail rejected

      Hello, we are facing problems sending mails. The IP has been blacklisted. Please, fix it as soon as possible. JunkMail rejected - sender4-op-o12.zoho.com [136.143.188.12]:17291 is in an RBL on rbl.websitewelcome.com, see Blocked - see http://www.spa
    • My emails going to spam folder for hotmail or outlook

      My emails (not spam mails) are going into the spam folder for my customers using hotmail. Gmail and Yahoo users are receiving the emails in their inbox. can you please solve this problem. I read few articles but coudnt find any solution to it. I am testing it by sending a simple text email no pictures nothing at all still it is filtering my emails as spam. Please help I am really loosing time and clients due to this. Thanks
    • Capture hotkeys inside the remote session and allow file exchange via clipboard

      Hi guys, assist is a really good app, and to become great it would be nice to have some features other vendors have in place and we take them for granted. For example, ScreenConnect, TeamViewer and others allow you to send hotkeys via the remote connection,
    • Self Client Authorization Issue

      Hi. Trying to test the api integration for Zoho Desk with the Self Client - Client Credintials flow method. I've created the self client, obtained the client id and secret, inputted "Desk.tickets.ALL" as my scope, and "ZohoDesk.[My Zoho Desk Org ID]"
    • Mass pdfs into OCR field

      I am working on a Creator app that my org will use internally. Is there any way to mass upload pfs through a form with an OCR file upload field? Is Creator capable of this, or would I need to use Catalyst?
    • Cannot fetch url with custom extension (sigma - javascript)

      Hello i try to make my first extension with API request, i have two cases 1) this a deluge code attach to a button --> this one works very well response = invokeurl [ url :"my_api_fetch_url" type :GET headers:{"api_key":"myapikey","accept":"application/json","content-type":"application/json"}
    • how to upload the picture and document

      i want to upload the picture and document,would you please told how to upload them?could you told it for each step?
    • Forgot my email management account

      Hello, I am the administrator of ihomemix.com. I can’t remember which email address I used to register the account and then opened the email service for ihomemix. I can’t see the subscription period of my email function when I log in with this account.
    • Next Page