Automation#27: Retain Ticket Owner on Moved Tickets

Automation#27: Retain Ticket Owner on Moved Tickets


Hello Everyone!
This week, we present to you a custom function that retains the ticket owner when a ticket is moved from one department to another.
Here’s more to help you understand the custom function:
At Zylker Techfix, Alex, the Support Engineer manages customer interactions when gadgets are submitted for servicing. Alex creates a ticket for each device and ensures customers feel supported. However, when a device requires advanced troubleshooting, the ticket is transferred to the Technical Engineering department. By default, this transfer often changes the ticket owner or leaves it unassigned, causing Alex to lose visibility and leaving customers feeling disconnected.

To solve this, Zylker Techfix used this custom function that retains Alex as the ticket owner during inter-department transfers. This allows Alex to stay updated, connect with customers, and provide timely updates while the Technical Engineers focus on resolving the issue. With this solution, Zylker Techfix ensures seamless collaboration and a better customer experience, maintaining trust and delivering quick resolutions.

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 Disable the toggle for User Credentials of Login User.
  1.6 Under Scope, choose the below scope values:
Desk.tickets.READ
Desk.tickets.UPDATE
  1.7 Click Create and Connect.
  1.8 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 Create.   
8. Click Next.
 
9. In the Criteria section, add criteria if required. Click Next. 
10. In the Actions section, click the + icon and select New next to Custom Functions.
11. Enter a Name and Description for the custom function.                                           
12. In the script window, insert the Custom Function given below:
  1. deskUrl = "https://desk.zoho.com";      //Edit the domain based on your DC
  2. getTicketHistory = invokeurl
  3. [
  4. url :deskUrl + "/api/v1/tickets/" + ticketID + "/History?limit=50"
  5. type :GET
  6. connection:"deskconnection"
  7. ];
  8. ticketHistory = getTicketHistory.get("data");
  9. info ticketHistory;
  10. prevTicketOwner = "";
  11. i = 0;
  12. for each  history in ticketHistory
  13. {
  14. if(history.get("eventName").equalsIgnoreCase("TicketUpdated"))
  15. {
  16. historychanges = history.get("eventInfo");
  17. for each  hchanges in historychanges
  18. {
  19. if(hchanges.get("propertyName").equalsIgnoreCase("Department"))
  20. {
  21. i = i + 1;
  22. }
  23. if(hchanges.get("propertyName").equalsIgnoreCase("Case Owner"))
  24. {
  25. if(hchanges.get("propertyValue").containKey("previousValue"))
  26. {
  27. prevTicketOwner = hchanges.get("propertyValue").get("previousValue").get("id");
  28. i = i + 1;
  29. }
  30. }
  31. }
  32. info prevTicketOwner;
  33. }
  34. if(i == 2)
  35. {
  36. break;
  37. }
  38. }
  39. jsonString = {"assigneeId":prevTicketOwner};
  40. updateTicket = invokeurl
  41. [
  42. url :deskUrl + "/api/v1/tickets/" + ticketID
  43. type :PATCH
  44. parameters:jsonString + ""
  45. connection:"deskconnection"
  46. ];
  47. info updateTicket;
Notes
NOTE
In Line 2, Replace ".com" with the domain extension based on your Data Center.
13. Click Edit Arguments and include the argument mapping as below: 
  13.1 In the Name field, type ticketID and select Ticket Id under the Tickets Section.
14. Click Done.  
15. Click Save to save the custom function.
16. Click Save again to save the workflow.
Info
Additional Note
1. The Ticket Owner will be retained only if the agent is part of the department. 
2. Set up the workflow rule in all departments where tickets may be moved, ensuring the owner stays the same and the function works as intended.
This custom function streamlines workflows and enhances collaboration, ensuring a seamless customer experience. By keeping the original ticket owner, it helps to deliver efficient, customer-focused service every step of the way.

Until next time,
Regards,
Lydia | Zoho Desk 

    Access your files securely from anywhere



                          Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts



                                                            • Sticky Posts

                                                            • 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. 
                                                            • 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. 
                                                            • Welcome to Zoho Desk Community - Say hello here!

                                                              Hello everyone! Though we have been here for a while, it’s time to formally establish the Zoho Desk Community; we’re really happy to have you all here! This can be the place where you take a moment to introduce yourself to the rest of the community. We’d love to hear all about you, what you do, what company or industry you work for, how you use Zoho Desk and anything else that you will like to share! Here’s a little about me. I am Chinmayee. I have been associated with Zoho since 2014. I joined here
                                                            • Webinar 1: Blueprint for Customer Service

                                                              With the launch of a host of new features in Zoho Desk, we thought it’ll be great to have a few webinars to help our customers make the most of them. We’re starting off with our most talked about feature, Blueprint in Zoho Desk. You can register for the Blueprint webinar here: The webinar will be delivered by our in-house product experts. This is a good opportunity to ask questions to our experts and understand how Blueprint can help you automate your service processes. We look forward to seeing


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner





                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ










                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • Agents permission per department

                                                                                                              Hi Team,  can I setup permission for each agent what they can do in each department, for example I want account department agents to only have view access to support department tickets and not allowed to assign or reply to clients. I am sure this would
                                                                                                            • Open a popup window from inside Record A and stay on the record after saving Record B

                                                                                                              Hello community, Perhaps you can help me with the following topic. I have a form A with a decision box. When this decision box is checked, a form B pops up. Once Form B is saved, I need to stay on Form A to continue entering data. I've observed the following
                                                                                                            • Don't allow scheduling service on same day

                                                                                                              Is there a way when setting up a Service for people to schedule to not allow them to schedule it for the same day, only a future date? We don't want people scheduling their meeting/service without giving us time to prepare for it.
                                                                                                            • How to get the call recording external ID via desk API

                                                                                                              I have enabled phonbridge integration with Zoom Call. I am trying to access the call recording in Zoom by calling Zoom API. I have built a Desk workflow to trigger on a new call, to call a custom function. when calling the API, the response doesn't contain
                                                                                                            • Presenting the brand new Zoho Bookings!

                                                                                                              Hello everyone, Greetings from Zoho Bookings! We're happy to announce a new version of our product with enhanced features to simplify scheduling, coupled with a sleek interface and improved privacy across teams. Here's what you can expect from the latest
                                                                                                            • Expense Entry Error When Trying To Save (Related To Taxes)

                                                                                                              Hey folks, I've been trying to enter my first few expense entries in Zoho Books and I'm faced with the following error. "You cannot perform tax related operations when you are not registered for tax." But I have my HST/GST enabled and the tax rates are
                                                                                                            • Need the ability to have read only fields on a form.

                                                                                                              There needs to be functionality in Creator that allows a field on a form to be read only. Most screen building software applications have this capability. I know you can hide certain fields from specific users and that you can also make the whole form read only but that's not the functionality I need. I want to be able to create a form where certain fields are editable and other are for display purposes only (read only). For example if the form was displaying information on an item that the user
                                                                                                            • Onboarding Zoho sign documents?

                                                                                                              I was wondering something about using the Zoho sign integration with the candidate onboarding process. We set up the entire onboarding process and we have added documents that the candidate needs to review and sign digitally using Zoho Sign. This part
                                                                                                            • Email Templates - Is There a Ticket Placeholder for Billing Entity ID

                                                                                                              Was looking to add Billing Entity ID as a placeholder in a ZoHo email template. https://help.zoho.com/portal/en/kb/desk/customization/templates/articles/creating-and-managing-email-templates#Guide_to_Placeholders e.g. the placeholder for Account would
                                                                                                            • Integration with Woocommerce

                                                                                                              Hi, Do you have plan to make integration with other e-commerce platforms, for example Woocommerce / Shopify / Magento ?  Thanks. 
                                                                                                            • Se puede mover un Cliente de un modulo a otro personalizado

                                                                                                              Hola, tengo una duda que me gustaría resolver: Actualmente trabajo con dos módulos: Seguimiento de Venta y Cierre de Ventas . Mi objetivo es que, cuando desde el módulo de Seguimiento se marca una venta como "Venta Efectiva" , el cliente sea movido al
                                                                                                            • Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.

                                                                                                              Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.
                                                                                                            • Export Data & Attachments

                                                                                                              Hi, I am wondering whether it is possible to create an export of all data in creator, including attachments, for either backup purposes, or migration purposes. Thanks.
                                                                                                            • Apply partial payments to invoices from the Banking Module

                                                                                                              We need this! Why is this not possible?
                                                                                                            • Zoho Desk: Q1 2025 | What's New

                                                                                                              Hello everyone, Our first release for the year 2025 is here! Check out the Release Notes for more details The diverse capability of AI and its avatars has been the center of attention lately, and we've made some significant strides in this area. We now
                                                                                                            • Feature Request Improve parent-child relationship visibility

                                                                                                              Hi team, The Parent-Child ticket feature is great, but I've struggled to see the relationship between tickets when using ticket list views. It would be a great quality of life enhancement for users if child tickets were nested under parent tickets in
                                                                                                            • What is Resolution Time in Business Hours

                                                                                                              HI, What is the formula used to find the total time spent by an agent on a particular ticket? How is Resolution Time in Business Hours calculated in Zohodesk? As we need to find out the time spent on the ticket's solution by an agent we seek your assistance
                                                                                                            • Issues with Dashboard Filter and KPI in Zoho Analytics (CAGR)

                                                                                                              Hi everyone, I'm trying to build a CAGR (Compound Annual Growth Rate) KPI in Zoho Analytics, but I'm running into some issues with filter synchronization. Here's the scenario: I created two test reports: One that filters results from 2021 to 2025. Another
                                                                                                            • need a third party to fix email authentication dns records

                                                                                                              at my wit's end - zoho began giving me spf, dmarc, dkim errors two weeks ago fussed with it since and now it seems dkim is the only problem and when i added the dkim record with the key from zoho mail it still wont work tired of this, need someone who
                                                                                                            • How do i move multiple tickets to a different department?

                                                                                                              Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
                                                                                                            • Zoho Books Sandbox environment

                                                                                                              Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
                                                                                                            • Add Button on Tickets

                                                                                                              is there a way I could add another button on the ticket aside of "closed ticket" only. Like I want to add another button "Send & Pending", "Pending for Response" like that.
                                                                                                            • Enhancements in Canvas

                                                                                                              Dear All, Greetings! Canvas lets you design the record details page to suit your brand or business preferences. We are glad to introduce the following enhancements to uplift your design experience. Reusable Components Style Presets Let's go! Reusable
                                                                                                            • Currency fields and decimal places in CRM email templates

                                                                                                              Hi, How do I get more than the standard 2 decimal places showing in a Currency field, on an email template? In the Layout for my Currency field, it is set to 6 decimal places. I want to show up to 6 places in the email template (unrounded). See attached
                                                                                                            • Include Secondary Contacts (CCs) on Workflow Alerts

                                                                                                              Hi There, We use the Supervise Rules and Workflow Alerts to send automated messages to contacts in Zoho Desk. Most often, we are sending the ticket contact (our client) a reminder that we are waiting on their reply to our most recent message. The problem
                                                                                                            • Zoho Desk blank page

                                                                                                              1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
                                                                                                            • Adding a lead by sending email message

                                                                                                              Hello, Our Zoho Mail is integrated with Zoho CRM (we have Enterprise) and we can add new leads to CRM right from the web interface/panel of Zoho Mail using buttons at the bottom right corner of the screen. This is very handy. We add leads on a regular basis.    I was wondering though if it's possible to add a lead to CRM by simply forwarding an email message to a certain e-mail address. For example, in Evernote one can add a new note by sending an email message (with certain parameters) to a custom
                                                                                                            • Ask the Experts 19: Live Expert Panel Discussion - Inside Zoho Desk Spring Release 2025

                                                                                                              Hello again! Have you ever needed quick insights into key indicators to help manage and streamline specific operations? Have you started using AI to enhance your customer service in Zoho Desk? From configuring simple bots using Guided Conversations to
                                                                                                            • Ability to select Vendor Credits when creating Vendor Payments

                                                                                                              When making vendor payments there should be the option to select open vendor credits, this way the payment shows what bills and credits are being used for the payment Right now the vendor credits must be applied to the bills prior creating a payment,
                                                                                                            • No Sales Returns on SO's with Dropped Shipped items + Inventory Items

                                                                                                              We have encountered an issue in Zoho related to sales orders that include both dropshipped items and inventory items. Specifically, it is currently not possible to create sales returns for the company’s own inventory items from these sales orders. This
                                                                                                            • Show both Vendor and Customers in contact statement

                                                                                                              Dear Sir, some companies like us working with companies as Vendor and Customers too !!! it mean we send invoice and also receive bill from them , so we need our all amount in one place , but in contact statement , is separate it as Vendor and Customer, 
                                                                                                            • Filter a report for a specific bank and a specific transaction type (interest income)

                                                                                                              I am trying to run a report - any report - on a specific bank account for the interest income. I do not see it as an option. I can see the Bank Account under Account in the Filters, and I can see the Interest Income under Account in the Filters But I
                                                                                                            • ZMA v2 : Unable to delete a trigger from existing journey with several triggers

                                                                                                              I have multiple triggers on a single journey and need to delete one. However there isn't the function to do so, no delete icon or settings bar, no right click options of any kind. Every change I make affects all triggers ... How can I remove one of these
                                                                                                            • How to track the source of form submissions using referrer names in Zoho Forms?

                                                                                                              Ever wondered where your users are accessing your form links from? By tracking the origin of your form entries—whether it's from social media, email campaigns, direct links, or embedded on your website—you can identify which channels are driving the most
                                                                                                            • Snapchat

                                                                                                              Are there any plans to add Snapchat to Zoho Social or is there any API that we can use to integrate into Zoho.
                                                                                                            • Showing meeting acceptances in CRM that originated from Outlook

                                                                                                              Hello Zoho Team, We send meeting invitations from Zoho CRM. Many of our recipients use Outlook and therefore use the RSVP buttons from Outlook to respond. They rarely, if ever, use the RSVP buttons from the Zoho invitation. Unfortunately, the meeting
                                                                                                            • Widget JS SDK to Upload a photo to a record in a Module

                                                                                                              Good day,  I would really appreciate it if someone can assist me. I have written a widget, to be used in a Custom Module in CRM.  My goal: I want to upload a photo from my computer and display it in die "upload image" field. I am using the JS SDK: https://help.zwidgets.com/help/v1.1/index.html
                                                                                                            • Easy way to create task from call

                                                                                                              In Bigin I would like to have easy way of creating the tast directly from the call. Now after the call I need to enter company record and create task there. There must be some easier and more user friendly way to create new task after the call!
                                                                                                            • Zoho Creator Deluge - dynamically change fields depending on user input of field1 or field2

                                                                                                              Hi everyone and happy holidays! Hope that someone will help me figure out a solution to my problem… In my form there are currency, formulas and lookup fields. I’m well aware, that formulas fields if marked visible on form, cannot be hidden anywhere (like
                                                                                                            • Linkedin: when Zoho Social is going serious with it?

                                                                                                              Hi, it's been said in the past that Linkedin related features in Zoho Social were well behind those of other social networks because of limitations imposed by the platform. Now that we see around my tools (take taplio.com) frankly outpacing ZSocial on
                                                                                                            • Next Page