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 

    Zoho Campaigns Resources


      • Desk Community Learning Series


      • Digest


      • Functions


      • Meetups


      • Kbase


      • Resources


      • Glossary


      • Desk Marketplace


      • MVP Corner


      • Word of the Day


      • Ask the Experts


        • 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
        • 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. 
        • Zoho Desk Community Meetups 2019 - Canada

          Hey there!  ​ Are you making the best use of Zoho Desk? Do you think meeting and learning from other Zoho users in your city would help? If yes, then Zoho User Group Meetups is the right place for you! We're happy to announce our first Zoho Desk User Group meetups in Toronto, Montreal, Quebec City, Calgary, and Vancouver. These meetups are a great place to meet local Zoho users, Zoho Desk product experts and partners, all under one roof.    Join us as we discuss some key Zoho Desk features and share
        • 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. 

        Zoho CRM Plus Resources

          Zoho Books Resources


            Zoho Subscriptions Resources

              Zoho Projects Resources


                Zoho Sprints Resources


                  Zoho Orchestly Resources


                    Zoho Creator Resources


                      Zoho WorkDrive Resources



                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

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

                            Zoho CRM コンテンツ






                              ご検討中の方

                                • Recent Topics

                                • How to Initiate WhatsApp Message on SalesIQ?

                                  I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                • Introducing the New SalesIQ Live Chat Widget: Twice as Fast, Fully Optimized for Engagement!

                                  Hello everyone! To celebrate our 10-year milestone, we're thrilled to unveil the new and improved SalesIQ Live Chat Widget! Redesigned at both the User Interface and performance levels, this enhanced widget is not only optimized but also 2X faster than
                                • E-mails to suppliers

                                  Hi, i want to upload a spread sheet every day and send an e-mail to our suppliers every day (or when triggering a button?) with info from the spreadsheet lines. The supplier e-mail would be on each line. Unfortunately, when creating a scheduled automation,
                                • How can I transfer data from Production to Development environment?

                                  Hi, I am using Creator V6 and would like to bring all the data in production to the Development and Testing environments? Is there an easy way of doing that or I have to export and import each table?
                                • Issue Configuring SSO Integration with Cognito in Zoho Help Center

                                  Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
                                • Custom Roles & Granular Permission Control in Zoho SalesIQ

                                  Hello Zoho SalesIQ Team, We appreciate the functionalities offered by Zoho SalesIQ, but we would like to request a crucial enhancement regarding user roles and permissions. Current Issue: At present, Zoho SalesIQ provides fixed roles—Admin, Supervisor,
                                • Zoho Creator Upcoming Updates - October 2023

                                  Hello all! As we step into the final quarter of this year, we're ushering in a fresh wave of improvements and new features to supercharge your experience with Zoho Creator. Join us today as we present the newest updates and enhancements for this month:
                                • Sales without an invoice

                                  Sales without an invoice is not included on the “payments received” report. Also, sales without an invoice is not listed in the transactions under the customer’s profile, also making it easy to do a double entry. Is there a way for me to see my sales
                                • Rebrand your CRM with the all-new custom domain mapping setup

                                  UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
                                • Nested Sub-forms (Subform within subform)

                                  Hi Team, Whether there is any possibilities to add sub-form with in another sub-form like Main Form       -> Sub form A             ->Sub form B If we tried this, only one level of sub form only working.  Any one having any idea about this? Thanks Selvamuthukumar R
                                • CASE Module - email function

                                  HI there, I dont know if this has been asked or answered before as i couldnt find it on the forums. Issue: when a new case is raised, it goes under case tab and everything is captured. Then how do i send emails to the client who raised case with the details
                                • Enhancements to the formula field in Zoho CRM: Auto-refresh formulas with the "Now" function, stop formula executions based on criteria, and include formulas within formulas

                                  Dear Customers, We hope you're well! By their nature, modern businesses rely every day on computations, whether it's to calculate the price of a product, assess ROI, evaluate the lifetime value of a customer, or even determine the age of a record. With
                                • Zoho CRM Kiosk Upload Files

                                  Hello all, We are trying out Kiosks at the moment to see where it can fit best in our business. We are still a bit off in the application but lets say we will sort this out. My question is the following - when I create a Kiosk I can add "File Upload"
                                • Delay Function

                                  Hello, I would like to emphasize the importance of incorporating a delay functionality within custom functions, particularly in the context of integrating multiple platforms. As I understand, a delay function is not available by default in Zoho. However,
                                • Client Script | Update - Introducing Subform Events and Actions

                                  Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
                                • Whatsapp Connection Status still "Pending" after migration

                                  Hello, I migrated my WhatsApp API to Zoho from another provider a day ago. So far the connection status is still “Pending”. There is a problem? How long does it usually take?
                                • Marking a Desk ticket as Unread after merge

                                  We have a custom script that runs against every new ticket and auto-merges it with any existing ticket that matches our criteria. That works fine but there is no functionality that reverts the newly-updated ticket back to an "unread" state. I found the
                                • How to add a customized/dynamic Zoho Booking link in email footer?

                                  We just installed the latest version of the Zoho Desk <=> Zoho Booking extension from the marketplace and are quite happy to see the feature where a ticket-specific appointment booking link can be inserted in a reply. Is there any way to configure this
                                • Date Time

                                  Hi Everyone, I would seek some help about this concern that bugs me. I'm currently working using Zoho Flow to automatically plot a calendar on the Calendar Report. Whenever a ticket from Zoho Desk Field was updated this will trigger to create a plotted
                                • How to change contact record owner to its creator?

                                  When I convert a lead record into a contact and a deal then a the contact record will have User AAAA as record owner, and the contact record will have User XXXX as the record creator. I don't have any workflow rules in Contact module. I use the blueprint
                                • Custom function inside a CUSTOM BUTTON - BOOKS CUSTOM MODULE

                                  I am trying to upload the attachment in a custom module(Books) to a work drive. One module is working, but another module(New) is not giving me the desired result as it is also giving an error. Of course, I changed the module name etc. Attaching the script
                                • Function to update field in CRM Meetings from Bookings Appointment Status

                                  Hello, We're creating some reporting in Zoho Analytics using data from CRM and Bookings. Unfortunately it looks like when Bookings Appointments are carried over to CRM Meetings, the Bookings Appointment Status is not recorded in CRM Meetings. We would
                                • Introducing Bot Filtering for Accurate Email Campaign Analytics

                                  Update : This feature has been revamped. For the most current information and improved functionalities, please visit the updated version here. Dear Marketers, We're excited to announce a new feature designed to enhance the accuracy of your email campaign
                                • Zoho Meeting very bad video quality

                                  Hello, I need 1080p HD on my Zoho Meeting as explained here: Low Resolution/Quality Video (zoho.com) Currently, video quality is lagging with 400mb internet which is not acceptable for my business. My 1080p 60FPS webcam performs well on platforms like
                                • Multi Day booking for resources

                                  I have following business-case: Rental for Tablets. Customer should be able to select how many device for how many days he'd like to rent. Same as a car rental for multiple days. Is this possible with Bookings on the current version?
                                • How can I make time entry mandatory for tickets?

                                  Hi guys,  I just want to make a time entry field mandatory for tickets. How can I do that? At this stage of our usage, it's not mandatory and it could be forgotten to input a time for a ticket.  Thanks in advance 
                                • Set Mandatory Lookup Fields in Ticket Layout

                                  I added a custom module called 'Site' in the desk. I also added a lookup field 'Site' in the ticket layout. Now, I want the 'Site' field to be mandatory in the blueprint transition. How can I do that?
                                • When converting a lead to an account, the custom mandatory fields in the account are not treated by zoho as mandatory

                                  In my Account module I have a number of custom fields that I have set as mandatory. When I enter a new customer as a new account they work, I can't save the record without populating them. However when I convert a lead, my CRM users are able to save the
                                • Zoho Workplace gets yet another security boost: The addition of Zoho Vault

                                  Hello Community, Passwords are often the first line of defense, yet they're also one of the most common weak points. We're thrilled to announce that Zoho Vault is now integrated with Zoho Workplace! Zoho Vault Standard is now included at no extra cost
                                • Announcing new features in Trident for Windows (v.1.20.4.0)

                                  Hello Community, Trident for Windows is here with some new features to elevate your work experience. Let's take a quick look at what's new. Export emails. You can now export emails in the .eml file format as compressed zipped files to create a secure
                                • Best Carding Forum 2025 | Trusted Hacking Forum | Verified Carder Forum | Carder Forums 2025

                                  Best Carding Forum 2024 | Trusted Hacking Forum | Verified Carder Forum Welcome to Legitcarding.net , the #1 Trusted Carder Forum of 2024! Whether you're a seasoned carder or just starting out, our platform offers everything you need to succeed in the
                                • Automatic Email Alerts for Errors in Zoho Creator Logs

                                  Hello, We would like to request a feature enhancement in Zoho Creator regarding error notifications. Currently, Zoho Creator allows users to view logs and errors for each application by navigating to Zoho Creator > Operations > Logs. However, there is
                                • Quickbooks Online Customer Creation Code

                                  Hi! I'm looking for code that will automatically create a quickbooks customer account when clicking on a button located directly within Zoho CRM - Contacts Module. Here's what I have and I can't seem to figure it out. xxxxx is our company id which we
                                • Customers would like to add tips when paying in Client Portal

                                  I am happy with the clean interface of the Client Portal. However, I am running into a challenge: my customers would like to be able to add tips/gratuities when making payments. Currently, this is very clunky because they have to 1) manually over-pay,
                                • Multi-currency in Zoho CRM Forecast and Reports

                                  As a company we have branches in 4 different countries with as many different currencies. Our Sales Teams would like to work with their local currency as much as possible. The Forecast module using only 1 currency is practically usable only by the sales
                                • Change to copy/paste functionality in Deluge code editor

                                  Recently there was a change to the Deluge code etidor where it now inserts backslashes into strings automatically when copying/pasting strings with double quotes, it's a nightmare to have to go delete all these. Is it possible to toggle this on or off?
                                • CRM portal users can now log in using their mobile phone numbers

                                  Hello everyone! You can now invite portal users using their mobile phone numbers. These portal users will be able to log in using their mobile number and OTP. Templates for these portal-related SMS can be customized as per your needs. This enhancement
                                • Clear a date field?

                                  I've got a date field, let's call it Returned_date.  I'd like to write a script that clears the values from another date field called Expected_date upon a successful entry.  I know where to put the expression, but I'm having trouble building the expression.  Any assistance from anyone for a newb question would be appreciated.  Thanks in advance!
                                • Integrating ChatGPT with Zoho Creator for Automated Report Generation: Is It Possible?

                                  Hi everyone, I’m currently working on an application in Zoho Creator and would like to know if it’s possible to integrate ChatGPT to automate the generation of reports based on the data captured within the application. Has anyone successfully implemented
                                • There anyway to change a creator app Back to DEV thats not got a back up?

                                  As above, is it possible? Thanks.
                                • Next Page