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 

    • 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
    • Ask the Experts 10: A 5-hour online Q&A on Zoho Desk Best Practices

      Welcome to Zoho Desk's Ask the Experts session! This is a monthly discussion on our  forums; wherein a panel of experts will take on questions  specific to topics related to Zoho Desk. The panel will be available for a 5-hour period and will answer any questions posted here.   Let's begin the year learning some best practices from our experts. In this month's ATE we are opening the floor to questions on how to use Zoho Desk the best way.  If you have a business use case but not sure if Workflow is
    • 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. 
    • Ask the Experts 7: A 5-hour online Q&A on Telephony and Call Module

      Welcome to Ask the Experts session! This is a monthly discussion in forums; each session, a panel of experts will take questions on specific topics related to Zoho Desk. The panel will be available for a 5-hour period and answer any questions posted here. In this month's Ask the Experts, we will take questions on everything related to Telephony and the Call Module in Zoho Desk. We will discuss the following aspects:  Integration with different Telephony vendors Routing calls to agents Converting
      • Recent Topics

      • Change format of quantity format

        Hi,  I would like to change the qunatity format from 1,00 to 1.  Is this possible?   thanks!
      • Ticket Views: filter criteria -> dynamic date values in relation to the current date

        Hello all, It would be very helpful if you could build custom views in such a way that you do not have to adjust the criteria daily or at whatever interval in order to change the fixed date value as needed. For example, I would like to create a view that,
      • Captchas: No support for Google reCAPTCHA or similar

        Hi all, The current captcha integrated into Creator is very basic, and often near-impossible to read. I'm building an app for a charity which includes a couple of public-facing forms, and this is a real issue for people with dyslexia and related conditions - it's effectively excluding them if you want any form of spam protection at all on your published forms (and that being said, the current captcha doesn't even seem very effective - bots can often read it more easily than humans). I've raised this
      • Maintain consistency in ticket responses with shared snippets

        Hello everyone! We are excited to announce that our highly anticipated snippet sharing feature is now available to all users. As you know, snippets are pre-defined message templates, or canned messages, that help agents respond to tickets with efficiency.
      • Tickets - Zoho Desk

        Hi Team, My Clients need to see their tickets created and the status of the ticket in the Zoho Support Desk itself. How can I do this? My Client doesn't have a Zoho Account. They need to access the ticket by the provided link without signing in.
      • Automatically assign Contacts to Account owners

        Hi, I have a finite number of accounts set up in the CRM, and each new contact that comes in is automatically assigned to an Account according to a rule I set up. I want the Contact owner in the Contacts module to be assigned to the relevant Account owner.
      • Making Copies/Duplicates of Zoho Forms (Shared)

        Question to the community: is there a way to take a 'shared form' , make a duplicate copy and save under My Forms, so that i can use that which was already created as a template to make updates to and use as a test form and be able to have full access,
      • Using IMAP configuration for shared email inboxes

        Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
      • Can you help us creating a customised form with payment link?

        I would like to create a customised Transport form where the user will be asked to make payment basis the drop/ pick up they select.
      • Deleting or disabeling predefined ticket list views

        Is it possible to delete or disable predefined views or is this still not possible? For instance, we are not using the chat function and therefore have no use for the "Missed Chats" view. Thanks!
      • How to restore deleted Field

        I edited a field in zoho form and by accident I deleted a field (email address). The form is ongoing to be filled by respondent. Then, when I checked to the all entries and report, the email address is gone. I checked in audit log, there is a record that
      • Unable to load your extension. Please check your plugin-manifest or Resources.json.

        Hi Team, I am using the config module with multiple fields of different types, such as checkboxes and picklists. However, I am encountering the following issues: Error Message: When loading the extension, I get the error: "Unable to load your extension.
      • Remove or hide default views

        I'm looking to only have the views pertinent to my organization.  Is there a way to show only my custom views (or separate them to a different area or something)? If not, this should be a feature as switching from Zendesk we had this option...
      • No Sales Returns on SO's with Dropped Shipped items + Inventory Items

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

        Hello, is there a way to create a layout rule for quick create option? Regards, Katarzyna
      • Issue with Create Note Button and Popup Form in Leads Module

        Hello Zoho Community, I am trying to implement a "Create Note" button in the Leads module with the following functionality: 1. When the button is clicked, a form should pop up with fields to add notes. 2. After filling out the form and clicking Send,
      • Finding draft ticket replies

        Is there a way to see all tickets which have draft replies?
      • Guidance on Making Zoho Desk Connections Available for All Data Centers

        Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
      • Caso de Uso | Menos trámites, más salud: Clínicum optimiza sus recursos con Zoho One

        "La automatización del proceso de solicitud de bajas y su trazabilidad a través de Zoho nos ha supuesto una mejora en el ROI." - Carol Rodríguez, Responsable de Experiencia del Cliente interno y externo en Clínicum ¡Hola a todos! Estamos emocionados de
      • Is it possible to disable Chat Waiting Time, or to make it indefinite?

        We have used many online chat services over the years. However, Zoho's SalesIQ appears to be the only one we've tried that has a mandatory time limit where we must respond to new customer queries. We are a small business so we have no dedicated staff to monitor incoming chats, which makes this requirement very undesirable. (There have been no complaints from our clients when we're slower to follow up.) Is there an option I'm missing to turn Chat Waiting Time off, or to allow an infinite wait time?
      • Double opt-in notifications and customizable confirmation messages for your webforms

        Dear CRM Community, We are excited to announce a major upgrade to our Webforms feature. You can now customize the confirmation message shown to your users who double opt-in from your webform and also customize your confirmation emails when they submit
      • Bulk create tasks - Zoho Projects API

        Hi Zoho/Community, I am trying to create multiple tasks in a single API call, is there a way we can combine multiple request bodies into one single payload? The issue I am facing is the rate limiting on the API, I wanted to create certain amount of tasks
      • Task Due dates and Reminder Date & Time

        I like to have a reminder on many tasks in Zoho Recruit. I find the process cumbersome in that each task requires the following: 1. click and select due date 2. Click the reminder box 3. Click on (Reminder) Start Date 4. Click on (Reminder )Time If one
      • Unable to Access Admin Console and Email Sending Issues

        Hello Zoho Support Team and Community, I hope this post finds you well. I am currently facing two significant issues with Zoho services: Admin Console Access Issue: Every time I try to access the Zoho Admin Console, it gets stuck on the loading screen
      • Tracking new lead response time

        Hi, I have a team of Sales Development Reps, who have a KPI of responding to a lead within 20 mins or less once it hits the system.  I seem to recall that Zoho CRM had the capability to track this in a previous version, but don't see it anywhere.   It's
      • Getting The Following Error.. 550 5.4.6 Unusual sending activity detected

        I just launched a marketing campaign and I got this error. Everything was working fine previously. This is a big launch so need to fix it asap. Can anyone help?
      • mail

        Frequent sending of this email, what does this mean? How to solve it
      • Printing on 80mm bluetooth Pos Printer

        Hello. I am trying to print receipts and invoices using my 80mm bluetooth connectivity Pos printer. I have configured the Templates to Retail so that it matches the paper width of the Pos printer. However, when I click Print in zoho, first it opens the
      • Trying to integrate gmail but google keeps blocking Zoho access for integration??

        hi i am trying to integrate a gmail account so can track/access business emails this way. I have followed the instructions but after selecting my email account it gets re-routed to this message (screengrab below) Can anyone advise a way around this or
      • Which attribute in Zoho books invoice api represent branch attached to the invoice?

        Hi Zoho Team, We have done the integration with Zoho Books API. While fetching data from Invoice API we want to get branch value attached to the invoice. We could not figure out which field in "Get an Invoice" api represents branch value attribute. Thanks
      • How to Billed from two different GST Numbers

        How to Billed from two different GST Numbers. Suppose ABC & Co had GST registration in Delhi and Haryana and Zoho account is created with Delhi GST Registration number. Now i also want to issue invoice from Haryana GST Registration number. How can i proceed ?
      • How to hide Predefined views

        Hi, I would like to know how to hide: Predefined views and Recent views or some records from this list. If I'm using it form iPad I have to scroll to see User created views. Or maybe it's possibility to move User created views on the top. All the best,
      • Is it possible to trigger the review process when a record is edited?

        Hello, I need to trigger a review process whenever a field is updated to a specific value. This field is empty when the record is created and is only filled later. I know the approval process exists, but that's not what I'm looking for in this case. What
      • How to Customize Task Creation to Send a Custom Alert Using JavaScript in Zoho CRM?

        Hello Zoho CRM Community, I’m looking to customize Zoho CRM to send a custom alert whenever a task is created. I understand that Zoho CRM supports client scripts using JavaScript, and I would like to leverage this feature to implement the alert functionality.
      • Deleting Views

        How do you delete views? Please syd
      • Fixed Assets

        Where would I manage my fixed assets
      • Create a purchase order in vendor's currency

        I am having a problem working this out and would appreciate some suggestions. We have Books and Inventory working in tandem. We are in Australia, our product is sold in Australia in $A and obviously all our invoices, accounts and reports need to be in
      • Report on Assets

        Hi,  Is it possible to report purchased assets on a specific year? The Balance Sheet shows everything up to the current date, and the expense reports will not show purchased assets because they are assets not expenses. If it is not possible, then is it possible to setup an API connection with Books to extract data from to another Reporting application?
      • Purchase of Fixed Assets

        How can I record the purchase of assets using zoho books? For example, I purchased 4 laptop for 100000 $ each and paid it through my bank account. How can I record this transaction and maintain track of how much of the assets I bought?
      • Where is the Fixed Asset Register?

        I am a Zoho One user for 18 months, using invoicing and CRM and now ready to migrate my books to Zoho Books. Where do I keep the fixed asset register for the equipment that I use in my business? I have a service based business with a lot of gear and business
      • Next Page