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

    • Been getting this error, every now and then "Get count limit exceeded, please try again after 3 mins"

      it is really annoying.
    • The Zoho Meeting Video Quality Crisis—Survey

    • Tags on notes aren't syncing correctly on Android

      I've created notes on the desktop version that have several tags assigned, but on both my Android devices those notes only have ONE of those tags instead of all of them, despite the actual content of the note being correctly synced, and I'm also starting
    • Unlocking New Horizons: A Year in Review

      As we bid farewell to 2024, let's celebrate and revisit the key highlights of the year. From adding a new edition to cross-platform enhancements, here’s a roundup of all the feature updates designed to simplify accounting, optimize financial management,
    • US to EU Data Migration done / Workflows and Custom Functions stopped working

      Hello, I need help to restore my workflow rules and custom functions to work. My data was transferred from the US to the EU (Data center migration). Now all Workflow Rules and Custom Functions not working. I have no idea how to restore them to work again.
    • Campaign API Error 2001

      I'm getting a 2001 Error stating "Error in subscription. Please try after some time." I've waited but it continues to persist. I"ve copied and pasted the exact request on the API website yet that doesn't work either.
    • How to list Expenses that have not been matched to a Bank Transaction

      In ZoHo books I use expenses to record invoices I receive. I know I should probably uses Bills for this but Bills was not available in the Free edition I initially used. When I upgraded I contunued to use Expenses. I'm trying to find a way of listing
    • 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
    • How are you handing birthdays?

      I'm deciding on the best way to handle contact birthdays in my set-up. None of the options seem ideal, so I am interested in how others approach this. The aim is to have a usable ui to track birthday without knowing or requiring the year. I'm currently
    • Fiverr is better than Zoho Partners

      For anyone out there looking for help with Zoho Creator's confusing Deluge, I highly recommend hiring NON ZOHO PARTNERS on Fiverr. I've had much better experiences with those who are NOT certified by Zoho. Almost every single "certified" zoho partner
    • Another nightmare experience with a "Zoho Partner": Cloud Z Technologies

      I found "CloudZTech" on fiverr and I hired them to do a simple $300-$500 task. They did not deliver on time and I was forced to fire them. You guys must watch out for these fake ZOHO PARTNERS, 99% of them don't have the expertise necessary to help. I
    • 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
    • Marketing Automation pour maximiser le ROI : évaluer les performances et optimiser les campagnes

      Le Marketing Automation a transformé la manière dont les entreprises mènent leurs actions marketing, offrant une solution efficace pour simplifier les processus, améliorer la productivité et, surtout, maximiser le ROI. Dans un environnement commercial
    • Spotlight series #25 - Create presentation outlines using Zoho Show's Chrome extension

      Hello all, the feature in this month's spotlight is Zoho Show's Chrome extension. The first step to creating a good presentation is outlining your ideas—a crucial process that sets the foundation for everything that follows. But this often involves extensive
    • Email Notification to WordPress Blog Subscribers

      You know when a new WordPress blog is published, your subscribers will be notified via email with a link to that blog? Jetpack does it but I'm hoping to get away from it or any other specialized WordPress plugin (like MailPoet), and instead, use a dedicated
    • Noto Sans numericals appearance changed?

      Before the update on Christmas the numbers looked a little skinnier and in my opinion it looked really nice. Why did it change?
    • Option to Re-order from past orders

      Customers would like to place a repeat order with the business entity. Currently there is no option to support this and everytime the customer has to check out following the same process. Can a option be given to reorder from the past orders?
    • 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
    • Zoho Books API Limit Is RIDICULOUS!!!!!!!!!!!!!

      The 2,500 API call limit in Zoho Books is about as useful as AOL dialup.  Seriously Zoho, not only can I use up 2,500 API calls in no time with my own app but YOUR OWN STUPID IPAD APP blows through them super fast too, so if any one of my clients wants
    • Directly Edit, Filter, and Sort Subforms on the Details Page

      Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
    • Will zoho thrive be integrated with Zoho Books?

      title
    • Using Creator API access tokens in deluge script

      I am working on generating download urls for files that are uploaded via a creator form. I want to include these urls in record templates so they can be easily accessed. The goal is to make downloading multiple attachments in a record as quick and easy
    • Workload Reports

      Under Reports > Workload Reports, would it be possible to get Kanban view sorted by Task Owner? Seems like it'd be an easier/ quicker view of how many tasks are assigned to each user and what status they're at. Also gives you more information about the
    • attributed automatically database section

      Hello everyone and happy holidays... here in zoho CRM, I created 3 bases: - Properties (House, apartment ...) - Transactions (Notaries, ...) - Real estate ads I want when the address is identical on these three bases, that in "Properties" the transactions
    • Add an action to set agent as a member of a team in zoho desk

      Hi, Please add an action to zoho flow to set agent as a member of a team in zoho desk (add to a team or remove from a team). Regards, Ram
    • Remove County field from Customer Address input screen (or allow input to be deleted)

      We are in the USA and have just noticed that there is now a County field in the Customer Address input screen (and maybe other areas of Zoho Books, but this is the one affecting us at the moment). County is not important to our business, and in fact we
    • Custom Module I made shows the records I uploaded are there but they are not showing up.

      Here's a screenshot of the module - It shows there are around 2000 records but it says that there aren't any. The module is viewable by administrators and I am on an administrator account so I am not sure why the records aren't showing. Any help would
    • Display your zoho contact name when they call your mobile number

      As per the title If a contact calls the office number, the contacts name shows on mobile as long as I have their contact details registered in my crm. Is there a way that if the contact calls my mobile, their name can be displayed? Currently just their number shows when they call.
    • Webform & spam

      Hi, We set up 2 webform on our website, fowarding the content to Zoho CRM. Since it has been opened up, we are getting lot of spam message (for now about 20 a day). To lower the  amount of false new leads we added the captcha field and new enquieries are send to the Approval Leads list. However we still get some spam. Is there any "anti spam" mechanism built in Zoho CRM, or how is the best way to avoid these kind of spam ? Thanks
    • 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
    • Need Help with Journey in Zoho Marketing Automation

      Hello everyone, I’m new to Zoho Marketing Automation and am trying to build a journey that triggers based on the contract end date of customers. My goal is to send them an email with an ebook one day before their contract ends. To achieve this, I used
    • Locking Certain Feilds

      Hello! I was wondering if there was a way to lock certain fields from being changed until another field had been filled in. For example, my origination has a chain of blueprints that have to be filled in for someone to properly convert from the "Leads"
    • Announcing Trident desktop app for Zoho Mail & Zoho Workplace users

      Hello Community, I hope you are doing well and staying safe. As you know, our Mail & workplace teams have been constantly working on adding more value to our offerings to ensure you and your organization continue enjoying your Zoho experience. As part
    • Kudos to the Zoho Flow Team!

      Hi Zoho Flow Team, Way to go on the new design—it looks fantastic! We especially love the festive touch with the Christmas decorations. It's a delightful and thoughtful addition that brings a bit of holiday cheer to the experience. Keep up the amazing
    • Website not found when trying to unlock Zoho vault with fingerprint(authenticator) in windows 11

      Whenever I try to unlock the Zoho vault with fingerprint(authenticator) it shows the Website not found on the server. To replicate the issue follow the below steps: Download the zoho vault extension and login. And now open the zoho vault extension ->
    • Kaizen #170: FAQs on Notification APIs

      Hello all!! Welcome back to another post in the Kaizen series! In this post, we will address the most frequently asked questions about Zoho CRM's Notification APIs from the Zoho CRM Developer Community Forum. Notification API This API allows you to subscribe
    • Extracting data from cells in zoho sheets for zoho books

      I am currently uploading my bank statment in excel format to zoho workdrive. I would like flow to extract certain data and send it to zoho books. Would scripting in zoho flow be able to help me with this? By this I mean should I attempt this in zoho flow
    • Multiple templates (Settings > Email templates)

      Hi Zoho, We would like to have more options to select a template when sending an email in Zohosign. Currently we can only add 1 template per option: Is this possible? Kind regards, Tristan
    • Functions - How to pass Dynamic Parameters / Arguments?

      I am trying to create a generic function that I can use to update a given field with the name of the user and a given field with a datetime. The purpose of this is to have a history of major actions within the CRM record itself so it is easier to query
    • How to find the number that appears most often in a list (the Mode of a list)

      I have a list that contains a list of 5 string values. I want to find which value is repeated most often and place that value into a single line text field Example List1 = Learning,Learning,Shaping,Leading,Learning In List1 the value “Learning” appears
    • Next Page