Zoho Desk - Sync fields between contact module and ticket module

Zoho Desk - Sync fields between contact module and ticket module

Just helping the community by sharing a custom script that we implement. Always open to other ways to achieve this more efficiently.


Objective: I have different types of customers (I,E Vendor, Reseller, End-User),
  1. I want to record what type of customer they are when the customer logs a ticket.
  2. Store this data field against the Contact record
  3. Show this record on the ticket without having to have the agent open up the contact record
  4. Force the agent to update the Customer type field before allowing them to close the ticket
  5. If the customer logs any future tickets, those tickets will show the customer's type
Challenge: We can create custom fields on a ticket level and have them as required fields. But this data set belongs to the Contact record and not the Ticket record

Solution:

Part 1, Create the custom fields in the Contact Module
  1. Go to Customisation > Layouts and fields > Contacts
  2. Create a new field called Contact Type
  3. Note the API Name. In my case, it was called cf_contact_type
  4. I also set this to be a required field if we create the customer contact directly
Contact Module
Part 2, Create the custom fields in the Ticket Module
  1. Go to Customisation > Layouts and fields > Tickets
  2. Create a new field called Contact Type
  3. Note the API Name. In my case, it was called cf_contact_type
  4. I also set this to be a required field if we create the ticket directly
Ticket Module


We now have a drop-down list called Contact Type in both Tickets and Contacts.
But we need to keep them in sync. We do this in a Workflow

Part 3, Create a workflow to update the Contact Type in the Contacts module when the Contact Type in the Ticket Module is updated.

Create a new Workflow in Automation > Workflows


  1. Module: Tickets
  2. Rule Name: 1.A Ticket to contact module sync for Contact Type
  3. Description: Updating the contact type on a ticket record will update the person record
  4. Execute on: Field Update: Contact Type (This is the new Custom field you created)
  5. Criteria: N/A
  6. Action: Custom Function: Create a new and give it a name (Ticket to Contact sync)



Paste in the following code and substitute with your OrgId and DeskURL

substitute the contactCfApiName and ticketCfApiName if you changed it above
  1. OrgId = xxxxxxxxxx;
  2. deskUrl = "https://xxxxxxxxxx.com";
  3. contactCfApiName = "cf_contact_type";
  4. ticketCfApiName = "cf_contact_type";
  5. connection = "zohodesk";
  6. updateContact = invokeurl
  7. [
  8. url :deskUrl + "/api/v1/contacts/" + contactId
  9. type :PATCH
  10. parameters:{"cf":{contactCfApiName:ticketCfValue}} + ""
  11. connection:connection
  12. ];
  13. info updateContact;
1.A Function

Click on Edit Arguments and set the following Argument Names to these values
  1. contactId > Contact Id
  2. ticketId > Ticket Id
  3. ticketCfValue > Contact Type
  4. contactCfValue > Contact Type
Arguments

We now are updating the Contact Type in the Contacts module when the Contact Type in the Ticket Module is updated.
But we want to have any new tickets created from that customer pull in the Contact Type from the Contact Module into any new Ticket we create

Part 4, Create a workflow so that any new ticket created will auto-populate the Contact Type in the Ticket module from the Contact Module

Create a new Workflow in Automation > Workflows


  1. Module: Tickets
  2. Rule Name: 1.B Apply contact type value for all new tickets 
  3. Description: New ticket comes in, check person record if "customer type" is set and then copy it to the ticket
  4. Execute on: Create
  5. Criteria: N/A
  6. Action: Custom Function: Create a new and give it a name (

    Apply contact type value for all new tickets

    )
1.B Workflow

Paste in the following code and substitute with your OrgId and DeskURL

substitute the contactCfApiName and ticketCfApiName if you changed it above
  1. OrgId = xxxxxxxxxx;
  2. deskUrl = "https://xxxxxxxxxx.com";
  3. contactCfApiName = "cf_contact_type";
  4. ticketCfApiName = "cf_contact_type";
  5. connection = "zohodesk";
  6. if(contactCfValue != null && contactCfValue != "")
  7. {
  8. updateTicket = invokeurl
  9. [
  10. url :deskUrl + "/api/v1/tickets/" + ticketId
  11. type :PATCH
  12. parameters:{"cf":{ticketCfApiName:contactCfValue}} + ""
  13. headers:{"featureFlags":"skipAutomations"}
  14. connection:connection
  15. ];
  16. info updateTicket;
  17. }
1.B Function
Click on Edit Arguments and set the following Argument Names to these values
  1. contactId > Contact Id
  2. ticketId > Ticket Id
  3. ticketCfValue > Contact Type
  4. contactCfValue > Contact Type
Arguements
End result


When a customer logs a ticket, it will first look at their contact Record and see if the customer field Contact Type is set. If it is it will copy that to the Ticket record and display it.
If it is not set, making a change in the Ticket record will update the Contact Record

If you want to force your agents to fill in this field before they close the ticket. You can setup a Blueprint that during the transition Contact Type must be set

It looks like this




      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Zoho Desk Partners with Microsoft's M365 Copilot for seamless customer service experiences

            Hello Zoho Desk users, We are happy to announce that Zoho Desk has partnered with Microsoft's M365 to empower customer service teams with enhanced capabilities and seamless experiences for agents. Microsoft announced their partnership during their keynote
          • WhatsApp pricing changes: Pay per message starting July 1, 2025

            Starting July 1, 2025, WhatsApp is shifting from conversation-based pricing to per-message billing. That means every business-initiated message you send will count. Not just the first one in a 24-hour window. Pricing updates on the WhatsApp Business Platform
          • Live Webinar - Work smarter with Zoho Desk and Zoho Workplace integration

            Hello customers! Zoho Desk and Zoho Workplace are coming together for a webinar on 14th May, 2024. Zoho Workplace is a suite of productivity apps for email, chat, docs, calls, and more at one single place. Zoho Desk is closely integrated with a few tools
          • Apple iOS 17 and iPadOS 17 updates for Zoho Desk users

            Hello Zoho Desk users! Apple recently announced the release of iOS 17 and iPad OS 17. These latest OS updates will help you stay productive and efficient, through interactive and seamless user experiences. Zoho Desk has incorporated the updates to help
          • Zoho Desk Cheat Sheet For The Year-End

            Check out these Zoho Desk best practices to end this year on a high and have a great one ahead! #1 Set Business (Holiday) Hours - If you have limited working hours, please make sure you restrict your business hours or set them as holidays for the coming days. Let your customers know when you will, and won't, be available. #2 Update the Annual Holiday List - Check the holidays for the new year and update the holiday schedule. Usually, holidays from the current year will be carried over for the next

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ




                                ご検討中の方

                                  • Recent Topics

                                  • Workdrive on Android - Gallery Photo Backups

                                    Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
                                  • Auto sync Photo storage

                                    Hello I am new to Zoho Workdrive and was wondering if the is a way of automatically syncing photos on my Android phone to my workdrive as want to move away from Google? Thanks
                                  • Is anyone experience missing functions in the new UI until hard refresh?

                                    The set of functions including search is almost always missing upon loading an app in the new UI. If you refresh, the functions return. (see second screenshot) Anyone else experiencing this?
                                  • Conversion Rate – Won Deals over Assigned Prospects

                                    Hello, I would like assistance configuring a KPI in Zoho Analytics titled: Objective of the calculation: Number of Won Deals divided by Total number of assigned prospects (not only converted prospects). Important clarification: The denominator must include
                                  • emailing estimates

                                    Shows up in the customer mail logs as sent but nobody is receiving them, even when I send them to myself I don't get them ??? Something wrong with the mail server or my end ?
                                  • Not receiving New Ticket Emails

                                    Hello! The company I work for uses the Zoho ticketing system, however, I've noticed I'm not receiving email notifications when new tickets are published. I have admin rights to see these tickets on Zoho Desk and respond to them, but am not receiving the
                                  • Can't update a field on a parent form from a child form's On Success workflow

                                    Title: Can't update a field on a parent form from a child form's On Success workflow Hi everyone, I'm building a simple Golf Lesson Tracker app and I'm stuck on what should be a basic operation — updating a number field on a parent form when a child form
                                  • Approvals in Zoho Creator

                                    Hi, This is Surya, in one of  my creator application I have a form called job posting, and I created an approval process for that form. When a user submits that form the record directly adding to that form's report, even it is in the review for approval.
                                  • Upload from Zoho Creator File Upload field to OpenAI Vector Store

                                    I’ve struggled for quite a while to get this working properly. For a long time we relied on Azure Functions as a workaround to handle file transfers between Zoho Creator and OpenAI Vector Stores. It worked, but added unnecessary infrastructure and complexity.
                                  • Allow Admin to Configure Report > More Options Button

                                    As an Admin, I want to configure the options of the Report > More Options button to improve UX and reduce Developer overhead. See attached screenshot. Original question posted here: https://help.zoho.com/portal/en/community/topic/modify-standard-rep
                                  • Calendar start time limit

                                    Hi all, Has anyone found a magical way to filter calendar reports to start from, let's say 8:00, and not 0:00? Or at least to auto scroll there like Google Calendar for example?
                                  • Enable Free External Collaboration on Notecards in Zoho Notebook

                                    Hi Zoho Notebook Team, I would like to suggest a feature enhancement regarding external collaboration in Zoho Notebook. Currently, we can share notes with external users, and they are able to view the content without any issue. However, when these external
                                  • EU Problem

                                    Hi all, we've been facing issues with the Europe data center for two days. It's starting to disrupt our daily workflow. Any word on when this will be resolved?
                                  • Remove Profiles from "Forecast" Module

                                    How can I remove Profiles from My forecast Module? Image Below The only revenue generators are the VP's, and the Estimation Managers, and the Estimators subordinate to the Est. Managers. How can I remove the unused Profiles? Its frustrating to see them
                                  • How can I clone my website in order to try new templates?

                                    I want to try a new template for my existing Zoho website without the risk of changing the current site or accidentally publishing the wrong template. Therefore I thought a 'clone website'-option should be somewhere, but I can't find it. How do I try
                                  • Is it possible to update multiple work items at once?

                                    Hi, Is it possible to update the statuses/release tags of multiple work items at once? I came across this thread that says it's not possible at the moment, but it was related to the Sprints mobile app. Does this feature not exist in the website as well?
                                  • Custom Module Missing from Roles & Permissions List

                                    Hi Zoho Community, I created a new Custom Module in Zoho Expense. The module is fully built and I can see it in the Module Builder (Settings > Customization > Modules). However, I am unable to deploy this to my users because the module does not appear
                                  • Pivot Report Formula - using a today() variable

                                    Is it possible for me to use a value of today() in a formula on a pivot table? I'm trying to identify where the end date of a project is greater than the current date if("10. Projects (Zoho Projects).End Date" > today(), 'Yes', 'No') I get the error that
                                  • Custom view inconsistencies

                                    Why is "is not" missing from criteria, along with other comparison operators ??? It makes it almost impossible to build required custom views, I don't want "void" invoices listed & why on earth would "Void" invoices be showing when the criteria includes
                                  • Need Customer Item Inward Module along with QC

                                    Need Customer Item Inward Module along with QC 1. Using Transfer Orders hit the item balance sheet 2. Items without inventory it becomes difficult for tracking purpose. 3. Custom Modules become tedious to capture multiple items, item subforms are not
                                  • Zoho CRM Quotes – Subform and PDF/Writer Limitations

                                    Hello, I am encountering the following limitations in Zoho CRM Quotes: Custom product images cannot be uploaded in the subform – the image upload field cannot be added; only the file upload field is available. File upload placeholders cannot be used in
                                  • Apple Messages for Business in Omnichannel communications?

                                    Hello, Apple launched "Apple Messages for Business" but Zoho CRM or Zoho Desk don't appear in the list of possible integrators. Zoho already promotes https://www.zoho.com/crm/omnichannel.html Omni Channel integration, but Apple Messages does not yet appear.
                                  • Possible to Turn Off Automatic Notifications for Approvals?

                                    Hello, This is another question regarding the approval process. First a bit of background: Each of our accounts is assigned a rank based on potential sales. In Zoho, the account rank field is a drop-down with the 5 rank levels and is located on the account
                                  • Will be possible to create a merge mail template for products?

                                    Hi, we would need to create a mail merge template for products (native) module. Will be possibile? or do you have a smart solutions to merge products data with a mail merge? thanks Chris
                                  • Maximum incoming email (attachment size) limit

                                    I see that the maximum size of received emails can now be set to 20MB, however I'd still like to see it be larger. It's embarrassing when a client sends me an email with a large attachment and I can't receive it. 50, even 100 MB seems reasonable these
                                  • [Free Webinar] Learning Table Series - Multi-currency management in Zoho Creator

                                    Hello everyone, We’re excited to invite you to another edition of the Learning Table Series webinar. As you may already know, we've moved to a purpose-based approach in the Learning Table Series this year. Each session now focuses on how a Zoho Creator
                                  • LESS_THAN_MIN_OCCURANCE - code 2945

                                    Hi I'm trying to post a customer record to creator API and getting this error message. So cryptic. Can someone please help? Thanks Varun
                                  • Ranking by group in report

                                    Dears, I am new to Zoho Analytics and I would like to ask you guys help to creating a ranking column. Report type: Pivot Matter: I want to create a ranking column on the right of Percentage. This ranking is group by column Type, and ranking by Final Score/Percent.
                                  • How do I add a project template to a pre-existing project?

                                    Help....How do I add a project template to a pre-existing project? Right now I have to delete the old project, make a new one and add the project template at the time of creating the new project.
                                  • How to add line breaks in zoho.cliq.postToUser(...) message?

                                    In a CRM function using Deluge I'm sending this message and attempting to add some line breaks but they are ignored. Is there another way to add these breaks? My message: message: New urgent task\nDescription \nThis is a fake description.\n A new line?
                                  • Passing the image/file uploaded in form to openai api

                                    I'm trying to use the OpenAI's new vision feature where we can send image through Api. What I want is the user to upload an image in the form and send this image to OpenAI. But I can't access this image properly in deluge script. There are also some constraints
                                  • Users may not pick the fields to be shown as columns in the Choose Account window when creating a new Deal record

                                    Hi there, by talking with other users I found out that I, as an Admin, am the only one who can pick fields to be shown as columns in the Choose Account window when creating a new Deal record. In fact, if other users click on the "Add Column" symbol on
                                  • {Action Required} Re-authenticate your Google Accounts to Continue Data Sync

                                    Hello Users! To align with Google’s latest updates on how apps access files in Google Drive, we’ve enhanced our integration to comply with the updated security and privacy standards, ensuring safer and more reliable access to your data. With this update,
                                  • Why is the ability Customize Calls module so limited?

                                    Why can't I add additional sections? why can't I add other field types than the very limited subset that zoho allows? Why can I only add fields to the outbound/inbound call sections and not to the Call Information section?
                                  • Report Template - How to remove page break after each record?

                                    Hi, We have report template for a list report. It looks good at screen. But when printing, it creates a page break after each record. How to remove the it? So we can print multiple records in same page. Please look at the attached screenshots. Report Template Report Print Preview
                                  • Calendar report with order options and more quick view templates

                                    I think many of us regularly work with calendar-style reports. It would be great to be able to customize the quick view with new templates and have options to sort the entries for each day of the calendar by different criteria. I think this is an interesting
                                  • Sender Email Configuration Error.

                                    Hello Team, Hope you are all doing well. We are in the process of creating the Zoho FSM environment in the UAE. When we try to add the sender email address “techsupportuae@stryker.com”, we receive the error message: “Error occurred while sending mail
                                  • Shall we play a game?

                                    Presenting the very first game created using ZOHO Creator: Tic-Tac-Toe (or noughts and crosses) I made this to challenge myself and employ some of the new features of ZOHO Creator. I must admit that the code is very literal and not too elegant. There are plans to improve on the machine AI and streamline the code over time. Currently the code makes extensive use of functions for the machine "AI" - there are 12 of these.   The machine AI can be tricked, so to counteract that I made it exceedingly arrogant
                                  • Career site URL - Suggestion to modify URL of non-english job posting

                                    Hi, I would like to suggest making a few modification to career sites that are not in english. Currently, the URL are a mix of different languages and are very long. It makes for very unprofessional looking URLs... Here is an example of one of our URL
                                  • CRM notes

                                    I want to be able to add notes to a task that do not necessarily get rolled up into an account or contact.   For example, I tasks to work on a Court Order for John Doe divorce account.  There might be lots of updates (in the form of notes) that employees
                                  • Next Page