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. 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. }
Notes
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"}

13. Click Edit Arguments and include the argument mapping as below: 
14.1 In the Name field, type ticketId and select TicketId under the Tickets Section, from the Value drop-down list.
14.2 Add another Name field, type accountId and select Account Id under the Accounts Section, from the Value drop-down list.
14. Click Done. 
15. Click Save to save the custom function.
16. 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 

    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

                                                                                                  • Deluge Script to Reopen Ticket if Tasks are not Completed

                                                                                                    I have the following script, my goal is to have it automatically reopen the ticket when the ticket is closed if there are Activities assigned to the ticket that are not "Completed". This script seems to reopen the ticket if there are any tasks at all,
                                                                                                  • UK payroll entries

                                                                                                    Hey guys, Nett payroll payments are imported direct into the bank, using an external payroll system (will be glad for Zoho to have a UK payroll app) At present I have monthly recurring bills for HMRC which are auto entered & paid when due. This seems
                                                                                                  • What are the consequences of renaming a picklist value?

                                                                                                    What are the consequences of renaming a picklist value?
                                                                                                  • Integrating Zoho Creator with Google Drive

                                                                                                    I am interested in using Google Drive as a convenient repository to push files from file upload fields in my creator app. I am wondering if people have come up with best practices for this or even how viable it is. https://developers.google.com/drive/api/guides/manage-uploads#simple
                                                                                                  • Subform Lookup field showError doesn't clear in Client Script

                                                                                                    I have a lookup fields Deal, Account and Lead in Subform, I am checking if its null or not If its null It shows an error, but when I select some value for the Lookup Field it doesn't clear the error , for other fields such as single line or pickup etc.
                                                                                                  • Option to Manually Add and Verify DMARC Record

                                                                                                    Dear Zoho Mail Team, When configuring a new domain in Zoho Mail, we currently have the option to automatically configure the MX, SPF, and DKIM records. For each of these, we can either allow Zoho to create the records or manually add them to our DNS and
                                                                                                  • Zoho Desk & Tasks

                                                                                                    Hi, I'd like to be able to create a set of tasks each time a customer request comes in, as I understand it, currently each would need to be create manually. Project is too much of an overhead for what we want to use. Effectively in various use cases we
                                                                                                  • Working with Products that are non-tangible

                                                                                                    How does one create a 'service' in products? Is there a way to disable inventory functions for things like Sofware as a service? The services module doesn't look to be much help either. Not sure how to do this in CRM
                                                                                                  • Weekly Tips: Categorize Your Emails with Tags

                                                                                                    We send and receive hundreds of emails each week—ranging from work-related updates, personal messages, important documents, and even spam. With so many emails flooding your inbox, it can quickly become chaotic. Some emails are urgent, some are for reference,
                                                                                                  • Create vendor via API

                                                                                                    The Zoho Books web ui has an option to add a new vendor. Though I can't find an API to create a vendor. Is there an API available for creating a new vendor? Regards, Vinod
                                                                                                  • Function to check frequency of customer ordering patterns

                                                                                                    Hi, I'm no coder, so I thought I could make use of Chat GPT to generate some Deluge script to create a function that would check order frequency of our customers so that I could send an email if they go beyond their usual order pattern. Chat GPT and Claude
                                                                                                  • Customization of "List Price" naming convention

                                                                                                    Surely this has been brought up before, but does Zoho plan to allow the customization of the List Price field? For example, the ability to rename to: Sell Price Sale Price Market Price Ticket Price etc etc
                                                                                                  • Dashboard Analytics - Time to fill a job

                                                                                                    Hello! I'm creating a dashboard and want a chart that displays the recruitment SLA (time to fill) of job openings. I created a report that retrieves the SLA for each job opening. However, when generating the chart, the information does not appear as I
                                                                                                  • Zoho People U.S. Compensation Setup

                                                                                                    We're new to Zoho and Zoho People Plus. So far, we like what we see as an HRIS system to suit our small USA-based (under 20-person) non-profit. However, we can't figure out how to configure the Compensation Service to reflect our workplace. We'd simply
                                                                                                  • Zoho Desk - Archiving Contacts

                                                                                                    Hi, We have a lot of customers in Zoho Desk with associated contacts. When a contact leaves we want to be able to still have their tickets in our history as this is important. But we don't want to have all these contacts that no longer work for the company.
                                                                                                  • Zoho Desk integration with Power BI

                                                                                                    Hi, I want to be able to create a Power BI report which has live updates of ticket data from zoho desk, is this possile at all? Thanks Jack
                                                                                                  • Unified WhatsApp Number Management in Zoho Desk and SalesIQ

                                                                                                    Dear Zoho Desk Support Team, We are currently utilizing both Zoho Desk and Zoho SalesIQ for our customer support operations. While both platforms offer WhatsApp integration, we are facing challenges due to the requirement of separate WhatsApp numbers
                                                                                                  • Zoho books not accepting valid state code via api

                                                                                                    Hello, I am using make.com to create a contact and then invoice for a Shopify orders. However, while creating contact I'm getting "please provide a valid state code" error even though I'm providing correct state code. For example I'm providing MH as state
                                                                                                  • Create View to See Tickets Closed within the last 3 days

                                                                                                    I'm trying to create a view in Zoho Desk that shows me "recently closed ticket," which I will define as tickets closed in the last 3 days. I want this view to update so that whenever I click to view it is recalculates and shows me tickets closed within 3 days from that moment. When I try to Create a view and use the criteria of "Ticket Closed Time" I have to specify a discrete time frame (on or before a specific date). It doesn't allow me to define time/date dynamically like I can do with date fields
                                                                                                  • I'm so confused by the new (?) look

                                                                                                    I've been off Notebook for a long time, neglecting the app and never visiting the website. I decided to renew my commitment to it. It looks completely different! When I logged on before (app or browser page) I'd see a very pretty display of my multiple
                                                                                                  • Conexão de Meta Ads - A busca pelo Cálculo do ROI

                                                                                                    A empresa onde trabalho está em busca de calcular melhor o retorno sobre o investimento de das suas campanhas do Meta Ads. A zoho junto com a Google fez um excelente trabalho e disponibilizou o cálculo desse retorno de forma maestral com o dashboard abaixo.
                                                                                                  • Email alias per task list so these tasks don't get listed under a 'General' task list that we didn't create nor use

                                                                                                    Using an email alias to add tasks is very good for forwarding emails directly into Zoho Projects however everything gets listed under a 'General' task list which is counter-intuitive. It would be good to have an email alias for each task list so we can
                                                                                                  • Can Zoho Flows repeat Actions more than once?

                                                                                                    I'm attempting to make an intentional Zoho Flow loop using the below layout. However, when "WithinLimit" condition is met, the program fails to execute the action "Get & Add Request Co..." again. Is this by design? Is Zoho Flows unable to repeat actions
                                                                                                  • Workflow to auto close Open Deals after 7 days?

                                                                                                    I want to set up a Workflow to Automatically close Deals as Lost after 7 days from their created date, (Regardless of activity or not) I am new to Zoho however I read 2 different ways to do it. 1 required to create a custom Date field and the other looked
                                                                                                  • Enable Filtering by Notes in Accounts & Other Modules

                                                                                                    I noticed that we have the option to filter by notes in the Contacts module, which is great. However, in our company, we add notes specific to an Account, and currently, there's no option to filter Accounts with notes. Can this be enabled? It would also
                                                                                                  • Zoho Marketing Automation Cannot Sync Lookiup Fields

                                                                                                    Hello all, It seems that Zoho MA cannot sync Lookup fields from the CRM. Can you confirm if this is the case? Is there a workaround? Do you know if Campaigns can sync with custom modules and also with Lookup field in the CRM? Thank you!
                                                                                                  • Mail > Columns

                                                                                                    How do I add/remove columns in Mail views? I sent individual emails to multiple coworkers which I then moved to my Coworkers Folder. When I then view the Coworkers folder, all I see is the Subject (same for all), and the sender (Me).
                                                                                                  • Undo/redo when composing Mail

                                                                                                    Where is the undo/redo button when composing mail? I've new to Zoho, I've looked, I've searched and can't find it. What am I missing?
                                                                                                  • How can I edit the Picklist History?

                                                                                                    I was working with some custom functions in CRM that inadvertently triggered unwanted changes in a picklist history for the Accounts module. It is absolutely essential for the business that I roll these changes in the subform back because they throw off
                                                                                                  • Picklist reference value in REST

                                                                                                    picklist options can be configured to have a different reference value than the displayed one, should be helpful in things like multilanguage: https://help.zoho.com/portal/en/kb/crm/customize-crm-account/translations/articles/translations is there a way
                                                                                                  • Mass replace picklist value

                                                                                                    I need to rename picklist option from "Option 1" to "Option 5". The value "Option 1" is set in about 1000 records in my CRM module. I am also using the that picklist in Reports and Workflows extensively. should I: A/ rename the option value and its reference
                                                                                                  • Foreign currencies behaviour

                                                                                                    Ladies and Gentlemen, It's really good to hear that you are developing your product, which I like a lot, but honestly, I'm sure you have much simpler issues to deal with. Foreign currencies operations have a HUGE lack in your product. Transferring from
                                                                                                  • Journey : "Added to segment" trigger doesn't work automatically

                                                                                                    Hello, I’m experiencing an issue with our Marketing Automation 2.0 integration with Zoho CRM. We have multiple segments defined in Marketing Automation, each with criteria based on field values synced from Zoho CRM. If a field value changes in Zoho CRM,
                                                                                                  • Creator Simplified #6 : Create custom buttons for multiple records using form object

                                                                                                    Hey Creators! It's learning time! Requirement Perform actions for multiple records in a single button-click using a form object. Sample Use-case In an employee management app, the HR needs to send a mail on a button-click to all employees regarding a
                                                                                                  • OAuth integration issues

                                                                                                    I'm experiencing persistent OAuth errors when trying to connect Make with Zoho API. I've tried multiple approaches but keep encountering the following issues: First error: 'Invalid Redirect Uri - Redirect URI passed does not match with the one configured'
                                                                                                  • Bulk Delete Images

                                                                                                    How do I bulk Delete Images from Zoho Campaigns. We have been using the Zoho since 2019 and can still only see the option to delete images one by one and we have a lot of old Campaign imagery we don't need anymore. Thanks!
                                                                                                  • Whatsapp Notification For Cliq

                                                                                                    We have integrated WhatsApp Business into Zoho CRM, and messages are coming through to the CRM. However, I want a notification message to be sent to the data owner in Cliq when a new message arrives. This doesn't seem possible through rules. Is there
                                                                                                  • Bigin iOS app update

                                                                                                    Hello everyone! In the latest iOS (v1.11.3) version of the Bigin app, we have introduced the following features: Initiate a conversation with a contact on the ‘Messages’ module. Introduced a templates icon in the existing WhatsApp conversation. An option
                                                                                                  • Difference between the 'field_read_only' and 'read_only' fields exposed by the Fields Meta Data API.

                                                                                                    The API documentation describes the 'field_read_only' field to indicate that a field is read-only always, implying that no user can ever get the write access for this field. The 'read_only' field's description states that its value can change depending
                                                                                                  • Zoho eCommerce frontend

                                                                                                    Questions about the Zoho eCommerce frontend 1) can different frontends (websites) be used? Zoho eCommerce is the backend with 3 or more websites. 2) how can the Zoho eCommerce frontend be customized to better fit Responsive Breackpoints? thanks best regards
                                                                                                  • Next Page