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

    • Running Total % in Pivot with filters

      Hi there, I have seen a few posts on this topic, but i cant seem to find one that will work when applyig filters to the data. I have Rows and Data in a pivot view I want to show the running total of revenue as a % of the total for the data set. If i add
    • Can you modify "Last Activity Time" in deluge? If so what's the field name?

      I need to perform some bulk modifications on records in the Leads module, but I need to avoid changing the "last activity time" or "date modified" because I am using those fields to filter and sort leads for follow-up action. I cannot find an answer anywhere
    • Included in Zoho One?

      Will LandingPage eventually be included in Zoho One?
    • Console error with widget in View mode, not present in Edit Mode with ZOHO.CRM.API.updateRecord(config)

      hello i have that function to update an account records (from a widgets created with sigma) function handleCopyButtonCRMClick() { console.log('handleCopyButtonCRMClick'); /* * Fetch Information of Record passed in PageLoad * and insert the response into
    • Calendar - "pop up" locations

      One of the attractive features of google calendar and outlook calendar is that locations for events will start to automatically populate the location drop down menu as you type. Adding this feature to zoho calendar would be the final feature i need.
    • How to see changes with ZOHO.CRM.API.updateRecord(config) without reload page

      hello got a widget in account, trigger with a button i copy data to account when click on a button, in my popup All is working well. But i need to reload the page to see the update. How can i see the changes without reloading page, only when close the
    • Reports - custom layout - duplicate report

      Do you also have this problem and what is the possible solution? I duplicate a report that has a "custom layout". Unfortunately the custom layout is not duplicated. To be improved for a future release by Zoho. I export the custom layout and import it...
    • Select CRM Custom Module in Zoho Creator

      I have a custom module added in Zoho CRM that I would like to link in Zoho creator.  When I add the Zoho CRM field it does not show the new module.  Is this possible?  Do i need to change something in CRM to make it accesible in Creator?
    • Zoho LandingPage is integrated with Zoho One!

      Greetings to the Zoho One users out there! We're delighted to let you know that Zoho LandingPage is available in Zoho One too! With Zoho LandingPage, you can host custom-made landing pages, and persuade the visitors to dive deeper by making further clicks,
    • LinkedIn verification link and otp not receiving

      For the last 2 to 3 weeks I'm trying to verify my LinkedIn account to access my company's LinkedIn page, Linkedin is sending verification links and codes to this email address but I have not received any codes or links. Please help me here. Looking forward
    • 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,
    • 2024 Wrap: Rediscover these features and enhancements in Zoho CRM

      Hello everyone! I wish all of you a joyful and prosperous 2025! As we welcome 2025, I’m excited to share a recap of the year 2024 and highlight some of the coolest new features and enhancements we’ve added to the Zoho CRM platform. Last year, we announced
    • A quicker way to provide accountants access to Zoho Books, similar to Xero and Quickbooks

      Hey guys, I'm finding the procedure to give access to an external accountant to Zoho Books less than ideal. Having to create an account by Zoho instead of myself, and then wait for it to be given a license to then pass to the accountant seems a bit time
    • "Mark as Spam" not working as expected

      Dear support, in the below scenario, clicking on "Mark as spam" identifies only the first of the checked emails as spam, removes that email from the visible list and leaves the rest of the list still visible & unchecked. I've tried check-marking them
    • Upgraded to Zoho One but Zoho Meeting still says Free Plan

      I signed-up for the Zoho One plan. When exploring the applications included, I came across a problem with Zoho Meeting. It says it's the free plan. I emailed support but they sent me a link that doesn't work and, when I found the article on my own, it
    • 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
    • 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]"
    • 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?
    • Update Candidate Status Through Workflow in Blueprint

      Hi Team,  We have a blueprint built out with custom functions that update particular fields based on candidate actions. When particular fields are updated we need to move the candidate forward in the blueprint. We tried to do this through a workflow,
    • Zoho Canned respond do have a huge lag issue.

      Previously the Zoho canned respond works perfectly ... on once server update and all the Canned respond enconter huge lag... in the end cause most of the canned respond just shown code with /xxx and not the sentence....
    • Pay Contractor Timesheets

      I have contractors that fill out a timesheet. Each hour must be assigned to a current client. I need the easiest way to get the contracts paid. They are paid on an hourly bases. How can this be done?
    • ShipStation and Zoho Inventory

      Hello, I am looking to sync zoho inventory with shipstation ZOHO INVENTORY           SHIP STATION Sales Order  ==>  create ORDERS INVOICE  <==    Shipments What exactly does BETA mean on the Shipstation connector?  This is required for me to sign-on in the next month. Thanks in advance for your efforts
    • Saving slide elements

      I have created grouped items including text and animation that I want to use in later slides. (Like an animated logo) Is there a way to save these grouped elements in my library?
    • Are downloadable product available in Zoho Commerce

      Hi all. We're considering switching to Zoho Commerce for our shop, but we sell software and remote services. Is there a features for downloadable products? I can't find any information about this. Thank you very much Alice
    • Function #10: Update item prices automatically based on the last transaction created

      In businesses, item prices are not always fixed and can fluctuate due to various factors. If you find yourself manually adjusting the item rates every time they change, we have the ideal time-saving solution for you. In today's post, we bring you custom
    • Writing on sketch cards is bugged when zoomed in

      When zoomed in, it writes a noticeable distance above or to the side of where you're actually trying to write. The further you're zoomed in, the more noticeable it is. Zooming is also entirely absent on the desktop version.
    • Move site from WIX to ZOHO Sites

      I have a simple website on WIX.  I am wondering if someone is available to help me move this website - https://www.videothreezero.com/ to ZOHO.  Michael  Boston
    • 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?
    • Move a Contact from Current Account to a NEW Account

      I do not believe the functionality to Move a Contact from a Current Account to a New Account is not available. Please someone tell me I am missing something! I have been through designing, developing, using and selling CRM systems for over 25 years and had this functionality20+ years ago in other CRMs.  In the real world people move from one organisation to another. In the sales, finance and technical world it is nice to see the communication history with that person in their old account and also
    • Change work hours per day for employees

      Hello, Is there a way to modify the work hours per day for employees in Zoho projects? This would be helpful for resource allocation to more accurately see when an employee who works 35 hours a week vs 40 hours has a full schedule. Thanks.
    • Zoho CRM Automation Help: Send Email When Fault is Marked as Done & Module Relationships

      Hi everyone, I have the following User-Created Modules in Zoho CRM: Clients Assets Faults Handymen Every client can have multiple assets. Every asset can have multiple faults. Every fault is assigned to one handyman. What I Want to Achieve: ✅ I want to
    • Adding New Domain to Zoho mail

      Hi, I have one Zoho account already called for example "Awesome Animals". Under this account I have one domain already setup with zoho mail, example: - awesomecats.com I have another website as well which I want to add under this "Awesome Animals" account,
    • I cannot receive emails.

      I need help, I've tried everything but I still can't receive emails from other people. I can send it but I can't receive emails, When I created the email it was all in order and suddenly I can't get emails from anyone anymore.
    • 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.
    • Não foi possível enviar a mensagem;Razão:554 5.1.8 Email Outgoing Blocked.

      Preciso de ajuda não consigo enviar emails,conta recen criada
    • ERROR_CODE :554, ERROR_CODE :rejected due to spam

      Please verify bounce message: This message was created automatically by mail delivery software.  A message that you sent could not be delivered to one or more of its recipients. This is a permanent error.  xxx@thalesesec.com Error, ERROR_CODE :554, ERROR_CODE :rejected due to spam content yyy@thalesesec.com Error, ERROR_CODE :554, ERROR_CODE :rejected due to spam content  Received:from RMRPC (190.102.146.226 [190.102.146.226]) by mx.zohomail.com with SMTPS id 1376415816667533.3706558194896; Tue,
    • Request to Customize Module Bar Placement in New Zoho CRM UI

      Hello Support and Zoho Community, I've been exploring the new UI of Zoho CRM "For Everyone" and have noticed a potential concern for my users. We are accustomed to having the module names displayed across the top, which made navigation more intuitive
    • Expand Zia's Language Support and AI Capabilities

      Dear Zoho Desk Support, I would like to submit a feature request to improve Zia, the AI-driven support assistant in Zoho Desk. Currently, Zia only supports the English language, while other AI agents such as Gemini, ChatGPT, and Claude can work with a
    • Average Costing / Weighted Average Costing

      Hello fellow maadirs. I understand Zoho Books uses FIFO method of dealing with inventory costing, but do you guys have any plans to introduce average costing? We indians need average costing. It's part of our culture. Please. I beg thee. Thanks.
    • Links in Instagram

      Hi there, I have been using Later for a while now but keen to come back to Zoho Social as Later doesn't offer tagging of pages on Facebook but they offer something Zoho doesn't. You can add a link to your bio which opens up your profile feed where images
    • Next Page