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 


      • 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. 

        • Recent Topics

        • Pushing GCLID info from Gravity Forms to ZohoCRM

          We are switching to Gravity Forms from Zoho Forms and I cannot find any good info on how to make sure my GCLID tracking info is pushed through to the CRM through my new forms. There was an article in the documentation about placing something within the
        • Add tasklist from a template to Zoho Project using Deluge

          I have some tasklist templates that I want to be able to add to a project under certain circumstances. So if a project meets Condition A, add the tasklist from Template B to that project. If it meets condition C, add tasklist from Template D, and so on.
        • 'Add Tax To Amount' not reflected in Invoice

          Hi Zoho Support, I'm experiencing an issue with tax calculation display in my invoice template. Despite having "Add tax to amount" box checked in the template settings, the Amount column is not showing the tax-inclusive total for line items. Current behaviour:
        • Enhancing self-service capabilities with AI-based Zia Answer Bot

          Hello All, Zia Answer Bot is available with better accuracy to enhance the self-service capabilities of the platform and to empower the users to resolve queries independently. By leveraging knowledge base (KB) resources, the Answer Bot provides accurate
        • Rounding off rate in quote

          Hi team, Please help me to rounding of rate amount in quote
        • Zoho Flow custom functions "Error occurred while processing this request. Contact support for more details"

          Any ideas why this is happening? Zoho Flow custom function...
        • Introducing our latest privacy enhancement - Hiding email IDs in Zoho Cliq Networks

          Hello everyone, Zoho Cliq Networks offers a powerful collaboration platform that allows businesses to create dedicated digital workspaces for external vendors, partners, or individuals you want to communicate with professionally without adding them to
        • I need to add difference for Average Row at the end

          (Confidential data hidden here) Guys, hello! I have this graph, it calculates the averages of Retention and then shows the delta (2024 - 2023). In the 3rd column with delta Churn %, I want to show the difference between averages too, which would be (16.99
        • No encuentro la opción para crear una orden de compra

          No encuentro la opción para crear una orden de compra, soy nuevo, ya busqué tutoriales, pero no me aparecen dichas opciones.
        • Restrict Past Date in Zoho CRM Module

          How can I restrict from selecting a previous Date? I want only future dates to be selectable
        • Post on behalf of employees as well as business socials

          Is there a way to give our sales team access to social to add their own LinkedIn accounts, so that when we schedule business posts, we can also post on behalf of them at the same time so they don't have to repost etc.
        • Alignment of Company Information Page Structure in Zoho One and Zoho Desk

          Hello Zoho One Support, We appreciate the continuous improvements across Zoho products. Recently, Zoho Desk restructured the Company Information page into three distinct sections: Company Profile – Includes Company Name, Logo, Alias, Description, Website,
        • Trying to setup a record to automatically create on a weekly basis

          Hello all, I need multiple records to be automatically created on a weekly basis. What I'm trying to accomplish is, I have a maintenance database where I track when I work on IT related systems. Every week on the same days I perform backups on systems
        • Effortlessly advance through your CRM blueprints by including optional fields in transitions

          Editions: Professional edition and above DCs: All Release plan: This enhancement is being released in a phased manner to customers. It will soon be available to all users. [Updated on 5 Sep 2024] This enhancement has been released to all users in all
        • ZOHO Reports - Filter Logic?

          Hi, I need a way to apply filter logics such as ((1 AND 2) OR 3). All I can see as of now is a way to enter different AND filters in the respective filter column. But how can I add an OR filter? Any advice would be highly appreciated. Mark
        • [Client Script] How to get selected related record Id

          Hi Zoho, I set an client script button in related record list. We would like to fetch the selected record id/field for further action. But I don't know how to get the selected id. If there is not possible to get related record info, then what does the
        • Google ads - zoho crm integration problem

          dear zoho team we were starting to use google ads integration with zoho crm years ago.  but till April there was an error. we can see GCLID in zoho crm but we couldn't get any information from google ads. (keywords campaign name etc) is there any problem
        • How to merge duplicate products?

          merge duplicate products
        • How can I delete duplicate transactions?

          I want to delete the duplicates not simply exclude them. I have duplicates, because I had automatic bank feeds turned on (had to make sure this critical functionality was working before migrating to Zoho). Now when I import my csv's exported from Wave,
        • Automate posting to job site boards via Deluge/ or Schedule

          Hi Zoho Recruit Community, I'm working on automating a recurring job posting for a long-standing labor hire role that we update monthly. Right now, I can automate the creation of the job opening using scheduled tasks and Deluge scripts. However, the challenge
        • Customer Statement Template

          Hi. how can i add order number "customer LPO number" in the customer statement. regards
        • Is it possible to select the methods of inserting a signature (Not provider)

          Hi, I tried to search through the help pages and application interface trying to find if there's a way to limit the assigned signees, for example, allowing only images or drawing, and disallowing the automatic signature creator as per their name. It'll
        • How To Sync 'Deals' data To The Related Contact In The 'Contacts' Module

          Hi there! I'm looking to be able to sync Deals and Contacts. Basically, when someone places an order we have it syncing the order data to Deals, complete with the customer's name and email. Is there any way to have that Deal synced to the matching contact in the Contacts module? Presumably matching by email address. I'm familiar with Workflows, however it doesn't seem that Workflows work across different modules. We're looking to be able to run reports based on what the customer bought, but can't
        • Zoho CRM Appointments and Services

          The Appointments and Services modules are nice but very limited. Is there any chance that Zoho will make these more customizable or expand the fuctionality? Appointments Allow "Appointment For" lookup to the Deals module. For us and I'm guessing others
        • How to separate Vendor custom fields from Customer custome fields

          Hi, Customer and Vendor form are separated in Books. We are synchronising them with (respectively) CRM Accounts and CRM Vendors. We add Customer Fields in Customer & Vendors Fields in Books as the CRM has some we need to synchronize. But Books shows Vendors
        • Auto scan receipt multiplies values by 1000 where decimal separator is comma

          This is a new problem as it worked properly in the past but not since Jan 2025. Where receipts use comma as the decimal separator values are multiplied by 1000 when auto scanning which means the user must go back and edit the expense.
        • 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
        • Free webinar! The Zoho Sign Masterclass: The basics, latest features, and mobile apps

          Hi, Are you new to Zoho Sign or looking to brush up on its capabilities? This webinar will help you master Zoho Sign from the ground up, covering everything from the basics to the latest features. Whether you're an individual managing personal documents,
        • How to upload image from Creator field to CRM File Upload Field or Module Notes section

          Hello,  How can I upload an image from Creator Image Upload Field to CRM Module Image field (or Notes section).  The file upload field type would also work. I just cannot seem to find a way to upload the images from one application to another. Case: Field record requires images as part of the report. I would like the image from the field record form in Creator to be uploaded in the CRM as well as.  All of the other fields from the Creator Field Record Report work perfectly. Thank you very much for
        • Write-Off multiple invoices and tax calculation

          Good evening, I have many invoices which are long overdue and I do not expect them to be paid. I believe I should write them off. I did some tests and I have some questions:  - I cannot find a way to write off several invoices together. How can I do that,
        • Unable to pay bill from Prepaid Expense account

          Our transport vendor requires us to use their prepaid system.  We have paid R1150 upfront into the Prepaid Expenses account: As we use their services, we get billed.  These bills must obviously be settled by from our prepaid account.  I am unable to record
        • Whatsapp Integration not working

          Hello. My whatsapp integration does not seem to be working. I have created templates, but whatsapp messages do not go through. They keep telling me to use a templete, even though I do so.
        • 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?
        • Unable to import data into zoho analytics using the post man APIs of udemy for business

          Hi Can some one help me with the following Unable to import data into zoho analytics using the post man APIs of udemy for business through API beta feature, I have created the sample report in zoho analytics through the table structure but i am unable
        • errorCode":8504. What is wrong with my CONFIG?

          I can't determine what is wrong with my config. It worked properly until I added an additional field, but the additional field is just a number and shouldn't effect the config. I am attempting to do a bulk update add to an existing table based on this
        • Analytics report issue

          Hey, does anyone know why suddenly our Analytics report goes blank whenever we add a field from the contacts module? It shows when adding fields from all other modules. Thanks.
        • Send emails directly via Cases module

          Greetings all, The ability to send emails from the Cases module, which users have been eagerly anticipating, is now available, just like in the other modules. In Zoho CRM, Cases is a module specifically designed for managing support tickets. If your organization
        • Zoho CRM Calendar View

          Hello Zoho team, We need desperately a calendar view next to list, kandan and other views. I think it should be easy to implement as you already have the logic from Projects and also from Kanban View in CRM. In calendar view when we set it up - we choose
        • COST CENTER

          Hello, Is it possible to add cost centers.
        • High cpu load on client side by process sessionaudit.exe

          Hi, as stated above. This happens every time with different clients. Now, the first thing I have to do after making the connection is to go to taskmanager on client computer and kill the process 'sessionaudit.exe' If I don't their cpu is very high and
        • Next Page