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

    • Questions about To Do

      1. I created a To Do note on Android and there is a line sorting option in the options drop down menu. But I didn’t find such an option in the PC client. I really need this option. 2. Why is there no search in To Do on the PC client? 3. Why is there no
    • Introducing Offer Details Sync to Zoho People

      We've introduced a new option for the Zoho People integration that allows you to push offer details when a candidate is converted to an employee. This simplifies your recruitment-to-onboarding process by seamlessly syncing critical offer information,
    • Conversion of functions from Google Spreadsheets

      Hello! I use this formula "=QUERY(ResumoOrdemVencimento!A3:O38;"SELECT A,B,C,D,E,F,G,H,I,J,K,L,M,N,O WHERE C != '' ORDER BY C,G")" in Google Sheets but when importing my spreadsheet into Zoho Sheets the formula was not converted. The QUERY function brings data from another spreadsheet, and then I sort and apply conditional formatting. The order of data will change automatically as I update the source spreadsheet. What Zoho Sheets function is equivalent to QUERY? I have some other spreadsheets to
    • Copy, Duplicate, or Clone a Custom View?

      I searched the forums and didn't see anything on the subject. Is there a way to copy, duplicate or clone a custom view? I want a custom view similar to one I've already created. I just want the columns in different order.
    • Import from OneNote

      Is there a way to import notes from OneNote? 
    • In Zoho Forms - adding a Zoho CRM field for Contact barely shows any fields.

      I'm making a Zoho Form and I want to add a CRM field for Contact. I was expecting to be able to match the contact on the email address provided in the form. My standard layout has lots of fields but for some reason on the dropdown list in Zoho Forms,
    • 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
    • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

      so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
    • Is Bigin Really Free - Confused by notifications?

      I started to look at Bigin as I was under the impression it was free, but as I started using it I kept getting messages that my trial period was X number of days and to upgrade. When I see something like this I assume I am not on a free version of anything
    • 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
    • Tracking a loan from an investor - a new Bank or Credit Card

      I have an investor providing money from a HELOC (Home Equity Line Of Credit). I have also turned around and loaned this money to another company. But I want to track my outstanding balance of the debt that I owe to the HELOC. Would I / should I track
    • 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.
    • Multiple domains for same username and password

      I've come across this situation the vault is currently suggessting the passwords autofill option by the domain. wondering whether is there any option to save one password for multiple domains since the microsoft login has two domains https://login.microsoftonline.com/
    • Is there a way to sort report on record template by a specific field like date field

      Hi, Is it possible to sort the report on the record template by the date field and not the default Added Time. Please check the example bellow: The records are sorting by the added time I wand to change that by the date field,
    • Introducing Zia LLM: Zoho’s in-house Generative AI solution for CRM's AI capabilities

      Hello everyone, We're excited to announce the launch of our in-house Large Language Model (LLM) by Zia to power our AI offerings. What is LLM? LLM stands for Large Language Model, a powerful AI technology that processes and generates human-like text based
    • The Zoho Meeting Video Quality Crisis

      I'm evaluating Zoho One for my business in Switzerland, and I must address a critical concern that threatens our potential adoption of the platform—the persistently poor performance of Zoho Meeting's video conferencing capabilities. In today's digital-first
    • Pay run Error

      Trying to run the last payroll of the year. The payment doesn't get to the employee Due to Technical Glitch in Tool, kindly Help us and resolve IT's showing Technical Glitch from Bank Website But bank People saying contact Zoho team for further solu
    • How to make the default currency type in a certain module different from the base currency>

      We have US dollar as the base currency. Also we have two more other currency types. In a custom module, we would like to make another currency as the default one rather than USD. Is it possible to do? How? Thank you very much!
    • Track Contact's Employment/Account History

      Thank you in advance for all of your help! Is there a way, within Zoho, to keep track of a contact's employment history? For example, if John Doe is my contact at Account 1, but leaves the company and is hired by Account 2, can I... ...maintain John Doe
    • CRM became very slow

      Plz check asap. image failed to upload , workflow doesn't run
    • ZohoCRM Workflows Not Triggering After Tool Recovery

      I noticed that ZohoCRM experienced an issue earlier, and according to the status webpage (https://status.zoho.com/), all tools were reported to be fully restored as of 03:00 (PST) on December 30, 2024. However, ZohoCRM workflows are still not triggering
    • Switch to enable or disable sent notification when close a ticket

      Some time you need to turn off the notification email on closing a ticket. But the only way is in the Settings of Zoho Desk. It would be great to have a switch in the ticket just to disbale for once the notification mail when close the ticket.
    • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

      Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we prepare to welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory
    • Usuários do Zoho Recruit no Brasil

      Gostaríamos de interagir com outros usuários do Zoho Recruit. Acabamos de completar um ano de utilização. Quem mais usa? se usa outra qual é?
    • Deluge upload to upload file field

      Trying to upload a file to a field type Upload File. I believe I have most correct. I have a merge and download from writer. I have this same script in many other functions and it works fine. I then upload the file to ZFS and get a success response However,
    • Alternatives to using multi-select lookup field for a 1-many module relationship?

      I have 2 modules where I only need multi-select lookup option on one of them and the other always has a 1-1 relationship. Do I have to use a multi-select lookup field in this case? Is there another way to solve this? Am asking because I've hit the limit
    • Subform Time field showing as null in script.

      Good Afternoon everyone. I am trying to take the information from my subform and populate it into a multiline field in the CRM. The code below works with no errors. The problem is, it shows that the Open and Close (Time fields) are null. But they are
    • O que é o Code Studio no Zoho Analytics?

      Olá Pessoal, Colocando um pouco de informação sobre uma feature do Zoho Analytics chamada Code Studio. O Code Studio é: ‌Funcionalidade que permite desbloquear recursos de Data Science e Machine Learning (DSML) no Zoho Analytics. Utiliza código Python
    • Sobre qual tema você gostaria de falar em 2025?

      Olá Pessoal, Quais temas que gostariamos de explorar em 2025? - Zoho CRM Customizações Básicas - Zoho CRM Funções Personalizadas - Zoho Desk Básico - Zoho Desk Avançado - Zoho Analytics - Zoho Creator Deixe a sua opinião
    • Sobre qual tema você gostaria de falar em 2025?

      Olá Pessoal, Quais temas que gostariamos de explorar em 2025? - Zoho CRM Customizações Básicas - Zoho CRM Funções Personalizadas - Zoho Desk Básico - Zoho Desk Avançado - Zoho Analytics - Zoho Creator Deixe a sua opinião
    • Need manual aggregate column pathing help

      See linked video here: https://workdrive.zohoexternal.com/external/a5bef0f0889c18a02f722e59399979c604ce0660a1caf50b5fdc61d92166b3e7
    • Automatic Updates for Zoho Desk Extensions

      Dear Zoho Desk Team, I hope you're doing well. We would like to request the addition of an automatic update feature for Zoho Desk extensions. Currently, updating extensions requires manually searching for updates and clicking the update button. This process
    • Contemplating moving my site from WordPress to Zoho Sites

      Hi Everyone, We currently find ourselves in a situation where we ant to review and update our current sites content. We are small business owners, not developers. We currently use a wide range of Zoho products. We sometimes think about the possibility of either moving or just starting from scratch on Zoho Sites. I would like to know if anyone has done this and of course the things that need to be considered. We have spent quite a bit of time getting our current site positioned organically and I guess
    • 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
    • Creator Subform to CRM Subform

      Hello all, Has anyone successfully written data from a Creator Subform into CRM subform? I have a Creator form that once submitted creates a new Location in the CRM. Inside a Location there is a subform for hours of operation. I collect those hours in
    • How to view all departments on one dashboard or ticket view?

      Hi guys, We've just started using Zoho Support and found a very weird quirk. It seems that you need to click into each deparment to view the new tickets instead of just seeing a global dashboard of all tickets across all departments. Seems very odd, is this correct or are we missing something? If this is currently not possible, can someone from Zoho let us know if a global dashboard view is going to be developed soon? How soon? This is going to be a dealbreaker for us as we have lots of departments...
    • Is Drawing feature supported in zoho Sheets?

      Is there any option to draw arrows and some basic shapes such as circle , rectangle etc in zoho sheets? if so, can someone help me find it 
    • UI Arabic

      can i change the member portal UI to arabic in zoho community?
    • Conexion CREATOR x CRM

      Buenas tardes, Tengo un problema con un código que crea un registro en CRM. Revisé el CRM para eliminar los campos obligatorios, pero cuando ejecuto el programa, aparece el siguiente mensaje de error: {"code":"MANDATORY_NOT_FOUND","details":{"api_name":"data"},"message":"required
    • Is there a way to sync Tags between CRM and Campaigns/Marketing Hub?

      I wonder if there is a way to synch the tags between CRM and Marketing-Hub / Campaigns?
    • Next Page