Automation#24: Auto-Update custom field from Accounts to Tickets

Automation#24: Auto-Update custom field from Accounts to Tickets



Hello Everyone!
Welcome back to the Community Learning Series! 

This episode dives into how Zylker Techfix streamlines account-related ticket references. Previously, employees had to manually check account details to retrieve specific customer information, making the process time-consuming and inefficient.
To solve this, Zylker Techfix introduced a custom solution: a custom field that seamlessly syncs data between accounts and tickets. When a customer raises a ticket, the custom field in the ticket layout automatically fetches and updates values from the corresponding field in the account.
This integration has transformed their operations, enabling Zylker Techfix to map tickets to their respective accounts effortlessly. 
The result? Streamlined workflows and an improved customer service experience.
You can achieve better results in your ticketing operations, too! Here’s how to implement the custom function:

Prerequisites
1.1 Go to Setup (S) >> Customization >> Layouts and Fields. Select Tickets under Layouts and the required Department. Access the active layout and add a custom field of your choice.  
1.1.1 Hover the mouse pointer over the custom field created, click on the Gear wheel icon >> Edit Properties. Note the API Name under the Edit Field. Click Update. Then, click Save and Close
1.2  Go to Setup (S) >> Customization >> Layouts and Fields. Select Accounts under Layouts, and in the Department drop-down, select the default department. Access the active layout and add a custom field of the same type as you have added in Tickets layout (1.1) .  
1.2.1 Hover the mouse pointer over the custom field created, click on the Gear wheel icon >> Edit PropertiesNote the API Name under the Edit Field. Click Update. Then click Save and Close.     
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 deskconnection.
      2.5 Under Scope, choose the below scope values:
             Desk.contacts.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, 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. Leave the Criteria section blank and click Next. (Add a criteria if you require it.) 

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. Under Argument Mapping, give a desired Method Name. Map the arguments as below: 
12.1 In the Argument Name field, type ticketId and select TicketId under the Tickets Section, from the Value drop-down list.
12.2 In the Argument Name field, type accountId and select Account Id under the Accounts Section, from the Value drop-down list.                      
13. In the script window, insert the Custom Function given below:
  1. // ----<<<< User Inputs >>>>----
  2. // -- Replace ".com" with appropriate domain extension based on customer's location/DC --- 
  3. deskURL = "https://desk.zoho.com";
  4. //place the corresponding API name of the custom fields from the Accounts and Tickets layout
  5. accountTicketsFieldApiNameMapping = {"ACCOUNT_FIELD_API_NAME":"TICKET_FIELD_API_NAME"};
  6. // ----<<<< Initial Configs >>>>----
  7. logs = Map();
  8. logs.insert("ticketId":ticketId);
  9. updateTicketCFPayload = Map();
  10. //---------------------------
  11. try 
  12. {

  13. // ---- start your logic from here ----
  14. if(accountId != null && !accountId.isEmpty())
  15. {
  16. primaryAccountDetail = invokeurl
  17. [
  18. url :deskURL + "/api/v1/accounts/" + accountId
  19. type :GET
  20. connection:"deskconnection"
  21. ];
  22. logs.insert("primaryAccountDetail":primaryAccountDetail);
  23. if(primaryAccountDetail != null && primaryAccountDetail != "" && primaryAccountDetail.containsKey("cf") && primaryAccountDetail.get("cf") != null && !primaryAccountDetail.get("cf").isEmpty())
  24. {
  25. if(primaryAccountDetail.containsKey("cf") && primaryAccountDetail.get("cf") != null && !primaryAccountDetail.get("cf").isEmpty())
  26. {
  27. accountsCF = primaryAccountDetail.get("cf");
  28. for each  customField in accountTicketsFieldApiNameMapping.keys()
  29. {
  30. if(accountsCF.containsKey(customField))
  31. {
  32. updateTicketCFPayload.put(accountTicketsFieldApiNameMapping.get(customField),accountsCF.get(customField));
  33. }
  34. }
  35. logs.insert("updateTicketCFPayload":updateTicketCFPayload);
  36. if(updateTicketCFPayload != null && !updateTicketCFPayload.isEmpty())
  37. {
  38. updateTicketPayload = {"cf":updateTicketCFPayload};
  39. updateTicket = invokeurl
  40. [
  41. url :deskURL + "/api/v1/tickets/" + ticketId
  42. type :PATCH
  43. parameters:updateTicketPayload + ""
  44. connection:"deskconnection"
  45. ];
  46. logs.insert("updateTicket":updateTicket);
  47. }
  48. }
  49. }
  50. }
  51. }
  52. catch (errorInfo)
  53. {
  54. logs.insert("errorInfo":errorInfo);
  55. }

  56. info "logs: \n" + logs;

  57. if(logs.containKey("errorInfo"))
  58. {
  59.     throws "Error happen in the CF execution";
  60. }
NOTE
a. In Line 2, Replace ".com" with the domain extension based on your Data Center.
b. In Line 5, add the API name of the custom field created within the Account and Tickets layout in this pattern {"cf_account_field":"cf_ticket_field"}
14. Click Save to save the custom function.
15. Click Save again to save the workflow.

If you’d like to automate the updating of more custom fields between Accounts and Tickets, feel free to reach out to us at support@zohodesk.com
We’d love to hear how this solution works for you. Share your experience with us—your feedback inspires us to keep improving. Happy ticketing!

Until next week,
Warm regards,
Lydia | Zoho Desk 


      • 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

        • Recent Topics

        • Run workflow on data import in Creator 6

          How to run a workflow on data import in Creator 6?
        • Zoho AI Translate Task as Rest API

          I cant find any docs on how to use Zoho AI Translate Task from a rest api call https://www.zoho.com/deluge/help/ai-tasks/translate.html I am working on a custom Widget and I dont think I can execute zoho deluge ai translate task from a custom widget.
        • Include EVERYTHING in Language Files

          Hey, we are building out a system, that needs to be translated. The language files lack a few things though. 1. Blueprint names 2. Canvas View elements like tab names 3. ... Please include everything into these files, otherwise it's not really a multi
        • Canvas: Add Sections to Detail View

          Currently it is only possible to add fields to a canvas detail view. This makes Canvas hard to maintain, because everytime we add a field to our system, someone needs to go into the canvas view and add it there as well. This leads to additional work and
        • MS Teams for daily call operations

          Hello all, Our most anticipated and crucial update is finally here! Organizations using Microsoft Teams phone system can now integrate it effectively with Zoho CRM for tasks like dialling numbers and logging calls. We are enhancing our MS Teams functionality
        • Zoho Social - Queries about GST invoices and subscription

          Hi, I am going to purchase the Zoho Social tool with a yearly subscription. So, can you please help me with my below queries: 1. How I get the monthly GST Invoices? 2. What is the process of subscription? 2. How to cancel a subscription?
        • Entire notebook that had notes has disappeared

          I don't know how tf this happened. All I did was uninstall and reinstall the mobile app after fixing a bug I had. After I reinstalled the app, everything was synced back except for one folder which had a bunch of notes in it. None of those notes are in
        • Add a Way to Duplicate Cards in the Same Canvas (Retain All Settings)

          Dear Zoho SalesIQ Team, We would like to request a new feature in Zoho SalesIQ: the ability to duplicate an existing card within the same canvas while retaining all of its information and settings, including conditions, configurations, and display preferences.
        • Sales IQ needs to capture both first and last names

          Sales IQ chat only has one field for name. When this then syncs with Campaigns, the field populates the "last name" field in Campaigns. However most people fill in the "name" field of Sales IQ with either their full name or their Christian name. This
        • Multi-Card Selection and Cross-Zobot Copy-Paste Functionality

          Dear Zoho SalesIQ Team, We’d like to suggest a productivity-enhancing feature for the Zobot builder in Zoho SalesIQ: the ability to select multiple cards (modules) at once using a selection area, and then copy-paste them either within the same canvas
        • Update Lead Status in Zoho CRM When a Meeting is Booked via Microsoft Bookings

          Hi everyone, I’m trying to streamline our lead management process and would like to automatically update the Lead Status in Zoho CRM whenever a meeting is booked through Microsoft Bookings. Has anyone successfully implemented this kind of integration
        • Zoho Books Custom Widgets Deprecation Error

          I created a simple sample widget with zet and published it using sigma Both in the Sandbox and Production the Widgets are showing this error
        • Personal Link / Meeting ID

          with zoho meetings do I have my own personal link to my 'meeting space' ? I have an email template in Zoho CRM which confirms people's appointment with me, I would like to include the link to my Zoho Meetings so that they have it in advance. How do I
        • Import from Linkedin

          Please provide a way to enable importing contact information for Contacts and Companies from Linkedin? Thanks
        • Search Bar Improvement for Zoho Commerce

          Hey everyone, I've been using Zoho Commerce for a bit now, and I think the search bar could really use an upgrade. Right now, it doesn't show products in a dropdown as you type, which would make finding items a lot faster. On Shopify, for example, you
        • Ability to Initiate WhatsApp Template Messages in Zoho SalesIQ Without Preexisting Chat

          Hi Zoho SalesIQ Team, I hope you're doing well. I understand that with the WhatsApp integration in SalesIQ, clients can contact us via WhatsApp, and we can use WhatsApp templates to send messages outside of the 24-hour window by reopening an existing
        • Pick List Issues

          I have created a pick list that looks at a table in a sheet, it selects the column I want fine. Various issues have come along. The option to sort the pick list is simplistic, only allows an ascending alphabetical sort. Bad luck if you want it descending.
        • Related Lists filter

          I have Contacts showing in our Accounts module. I customized the Contacts module with an Employment Status field, with the following picklist options: "Primary Contact", "Secondary Contact", "Active Staff(not a main contact)", and "No longer employed".
        • Automation Assistance for Zoho Form Integration and Workflow

          Hi, We are currently using a Zoho Form to send out our Global Credit Application and would like to automate the process further. Specifically, we’d like the ABN number submitted through the form to automatically populate the GST/VAT Number field in Zoho
        • Is it possible to Bulk Update 'Product Name' in Zoho Desk?

          Is it possible to Bulk Update 'Product Name' in Zoho Desk? I cannot see that option now. Kindly help how we can do it.
        • Useful enhancements to Mail Merge in Zoho CRM

          Dear Customers, We hope you're well! We're here with a set of highly anticipated enhancements to the Mail Merge feature in Zoho CRM. Let's go! Mail Merge in Zoho CRM integrates with Zoho Writer to simplify the process of customizing and sharing documents
        • Adding Overlays to Live Stream

          Hello folks, The company I work for will host an online event through Zoho Webinar. I want to add an overlay (an image) at the bottom of the screen with all the sponsors' logos. Is it possible to add an image as an overlay during the live stream? If so,
        • Product Details's Description is lost

          Hi CRM lost its description in Product details subform. Can you make some test before deploy any update?
        • Zoho arrives to Spam on all Microsoft Accounts (Outlook, Hotmail, Microsoft 365)

          I believe this is a very serious issue. All my email accounts in Zoho arrives straight to SPAM. Thing is, a lot of clients rely on email arriving to Inbox, specially on Microsoft Accounts since it is used a lot both for business and personal email sending.
        • Campaign Links Blocked as Phishing- Help!

          We sent a Campaign out yesterday. We tested all of the links beforehand. One of the links is to our own website. After the fact, when we open up the Campaign in our browser, the links work fine. The links in the emails received, however, opened in a new
        • ADDDATE formula using 2 calculations

          Hello, I want to create an ADDDATE formula using 2 calculations, add 1 month and deduct 1 day. the formula that I need should look like this: ADDDATE(due_date, 1, "Months")+ ADDDATE(due_date, -1, "Days") Each row itself works fine, but when I'm trying
        • Best way to handle a credit card download fiasco

          Hi there, hoping that someone knowledgable with book keeping can give me the answer here. One of my credit cards has been integrated with Zoho books and we have been downloading transactions with no issue. The credit card got compromised and was used
        • Making money out of Zoho Sheets - How?

          Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
        • How Do I Refund a Customer Directly to Their Credit Card?

          Hi, I use books to auto-charge my customers credit card. But when I create a credit note there doesn't seem to be a way to directly refund the amount back to their credit card. Is the only way to refund a credit note by doing it "offline" - or manually-
        • The ability to format text fields, ie when data is number or currency

          Hello, I have spent some time trying to determine how to accomplish this but it appears to be impossible. I want to merge a currency field from CRM into a PDF document. The CRM data shows $1,234, but when zSign gets the data it shows 1234 in the text
        • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

          so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
        • Specify in-line image size in question

          I have an image inserted into a file upload type question. I can click and drag the corner of the image to make it larger or smaller, but I would like to manually input the dimensions I need. No matter what size I make the image in photoshop before uploading
        • On click of the Blueprint transition (Qualified or Not Qualified), the 'Convert' option should be enabled in the Lead module.

          On click of the Blueprint transition (Qualified or Not Qualified), the 'Convert' option should be enabled in the Lead module. console.clear(); let convertButton = ZDK.Page.getButton('convert'); let leadStatus = ZDK.Page.getField('Lead_Stage').getValue();
        • Mobile Display Issues on Zoho Sites After Recent Update

          Hello! I’m currently facing an issue with my Zoho website that I created for my small business. After the recent updates, I’ve noticed that my site is not displaying correctly on mobile devices. Specifically, the layout appears distorted, and some elements
        • View Linked Subscription on Invoice list

          When looking at the list of invoices in billing is it possible to see the subscription that an invoice is for. This would allow you to see if it's a subscription a customer is behind on, or they simply haven't paid a one time invoice.
        • Can i set per-client hourly rate in Zoho Desk and not to correct the calculation on invoice?

          We use Zoho Desk to run one ticket per client per month. All time entries go to the ticket, we have to enter hourly rate manually and then correct it when we do the invoicing at the end of the month. So, our workflow is as following: I worked for 30 minutes,
        • Zoho Desk + Jira integration - Email notifications and comments posted by administrator instead of real user

          Dear All, I set up the integration under my admin account, and now when users leave comments in Jira (to created tickets in Zoho Desk), the email notifications show that the ‘Administrator’ left a comment, not a real user. The same happens in the ticket
        • Unable to add Agents

          I am trying to add agents to my account. While filling the details and sending invitation, the system mentions that invitation is sent. But no email is received on the user side. I have tried this multiple times and have also checked Spam and other
        • Auto CC - Moving Departments

          We have Auto CC e-mail replies to your support mailbox enabled. We have two departments: Helpdesk (helpdesk@domain.com) Delivery (delivery@domain.com) If we create a Helpdesk ticket, and reply, replies are CC'd to helpdesk@domain.com (OK) We then move
        • How to add new widgets?

          Searched and searched and cannot find anywhere. Why is everything so hidden in zoho! Why is there not a button right here that allows me to create a new one, why is it buried somewhere else! Zoho's UI is so infuriating
        • Next Page