Automation #15: Automatically Adding Static Secondary Contacts

Automation #15: Automatically Adding Static Secondary Contacts



Rockel is a top-tier client of Zylker traders. Marcus handles communications with Rockel and would like to add Terence, the CTO of Zylker traders to the email conversations. In this case, the emails coming from user address rockel.com should have Terence looped in automatically as the secondary contact.

Like Zylker, many users have the requirement to include secondary contacts while communicating with their customers. Here's for you the custom function to automatically add static secondary contacts while responding to an email.

Prerequisite
1. Enable Secondary Contacts (CCs) in Tickets
Navigate to Setup >> Customization >> General Settings >> Tickets >> Secondary Contacts (CCs) in Tickets >> Configure(If not enabled) or Edit Configuration(If enabled), select the department to which you want to implement the automation.


2. Create a Connection
To establish a connection, perform the following steps:

      2.1 Go to
Setup and choose Connections under Developer Space.
      2.2 Click
Create Connection.
      2.3 Select
Zoho OAuth under Default Connection.
      2.4 Give the connection name as
secondarycontact.
      2.5 Under
Scope choose the below scope values:
            Desk.search.READ
            Desk.tickets.READ
            Desk.tickets.UPDATE
            Desk.tickets.CREATE
            Desk.contacts.READ
            Desk.contacts.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 under Module.
4. Enter a Rule Name and Description for the rule.
5. To activate the rule, select the Active checkbox. Click Next.
In the Execute on section, follow these steps:
6. Select Create checkbox to execute this rule every time a new ticket is created. Click Next.
7. In the Criteria section, specify the criteria as "Email contains @zylker.com" and click Next
8. In the Actions section, click the + icon and select New next to Custom Functions.
9. Enter a name and description for the custom function.
10. Under Argument Mapping, give a desired Method Name. Map the arguments as below 
   10.1 In the Argument Name field , type ticketId, and from the Value drop-down list select Ticket Id under Ticket Information.
   10.2 In the Argument Name field , type ticketContactId, and from the Value drop-down list select Contact Id under Contacts Information.
   10.3 In the Argument Name field, type orgId, and from the Value drop-down list select specify custom value and enter your Zoho Desk. OrgId. To  get Zoho Desk OrgId, navigate to Setup >> Developer Space >> API.                  
11. In the script window, insert the Custom Function given below:
  1. //--------------- User Input -----------------
  2. Email = "STATIC_EMAIL_ID"; // Static email ID
  3. deskURL = "https://desk.zoho.com";
  4. //-----------------------------------------------
  5. logs = Collection();
  6. secondaryContacts = list();
  7. ticketDetails = zoho.desk.getRecordById(orgId, "tickets", ticketId, "secondarycontact");
  8. logs.insert("ticketDetails": ticketDetails);
  9. secondaryCC = ticketDetails.get("secondaryContacts");
  10. if (secondaryCC != "" && secondaryCC != null)
  11. {
  12. secondaryContacts = secondaryCC.toList(",");
  13. }
  14. searchParam = Map();
  15. searchParam.put("from", 0);
  16. searchParam.put("limit", 1);
  17. field1 = "email:" + Email;
  18. encryptEmail = zoho.encryption.urlEncode(field1);
  19. searchParam.put("field1", encryptEmail);
  20. contactSearch = invokeurl
  21. [
  22. url: deskURL + "/api/v1/contacts/fieldSearch"
  23. type: GET
  24. parameters: searchParam
  25. connection: "secondarycontact"
  26. ];
  27. logs.insert("contactSearch": contactSearch);
  28. if(contactSearch != null && contactSearch.get("data") != null && contactSearch.get("data").size() > 0)
  29. {
  30. contactId = contactSearch.get("data").get(0).get("id");
  31. }
  32. else
  33. {
  34. createConatctParam = Map();
  35. lastName = Email.getPrefixIgnoreCase("@");
  36. createConatctParam.put("lastName", lastName);
  37. createConatctParam.put("email", Email);
  38. createContact = invokeurl
  39.     [
  40.      url: deskURL + "/api/v1/contacts"
  41.      type: POST
  42.      parameters: createConatctParam.toString()
  43.      connection: "secondarycontact"
  44.     ];
  45. logs.insert("createContact": createContact);
  46. contactId = createContact.get("id");
  47. }
  48. logs.insert("contactId": contactId);
  49. if(contactId != null && contactId != ticketContactId)
  50. {
  51. secondaryContacts.add(contactId);
  52. updateParam = Map();
  53. updateParam.put("secondaryContacts", secondaryContacts);
  54. updateTicket = invokeurl
  55.     [
  56.         url: deskURL + "/api/v1/tickets/" + ticketId
  57.         type: PATCH
  58.         parameters: updateParam.toString()
  59.         connection: "secondarycontact"
  60.     ];
  61. logs.insert("updateTicket": updateTicket);
  62. }
  63. info logs ;
Note: In Line 1 Email = "STATIC_EMAIL_ID", replace the "STATIC_EMAIL_ID" with the email address you prefer to be added in the secondary contact automatically. eg:  Email = "terence@zylker.com"
12. Click Save to save the custom function
13. Click Save again to save the workflow.

We hope this custom function fosters your experience with Zoho Desk. Stay tuned for regular updates and insights on our automation features in this space.


      • 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

        • Is it possible to use module field filters via URL parameters?

          It would be really convenient if I could quickly link to a filter. For reference, this is the filter functionality I'm referring to: https://help.zoho.com/portal/en/kb/crm/customize-crm-account/advanced-filters/articles/advanced-filters For example: My
        • Support for Custom Fonts in Zoho Recruit Career Site and Candidate Portal

          Dear Zoho Recruit Team, I hope you're doing well. We would like to request the ability to use custom fonts in the Zoho Recruit Career Site and Candidate Portal. Currently only the default fonts (Roboto, Lato, and Montserrat) are available. While these
        • Lightbox Pop-up form

          I would like to embed my form using the lightbox pop up. I don't want it to load automatically. I want it to load when some clicks the button. I can see this option, however when I use the "show pop-up launch button" on the website, the button automatically
        • Unable to remove the “Automatically Assigned” territory from existing records

          Hello Zoho Community Team, We are currently using Territory Management in Zoho CRM and have encountered an issue with automatically assigned territories on Account records. Once any account is created the territory is assigned automatically, the Automatically
        • Data Processing Basis

          Hi, Is there a way to automate the data processing for a candidate every time an application arrives from job boards, without requiring manual intervention? That is, to automatically acquire consent for data processing. I've seen a workflow that allows
        • Lightbox Pop-up form

          I would like to embed my form using the lightbox pop up. I don't want it to load automatically. I want it to load when some clicks the button. I can see this option, however when I use the "show pop-up launch button" on the website, the button automatically
        • Zoho CRM for Everyone's NextGen UI Gets an Upgrade

          Hello Everyone We've made improvements to Zoho CRM for Everyone's Nextgen UI. These changes are the result of valuable feedback from you where we’ve focused on improving usability, providing wider screen space, and making navigation smoother so everything
        • Customer Management: #5 Never Let the Customer Slip

          When Rahul started Knight's Watch Consulting, his focus was simple: deliver good work and keep clients happy. He offered one-time consulting projects, monthly advisory retainers and usage-based support for growing clients. Business was steady, and customers
        • 10GB Email Storage Limits in Zoho CRM

          We’ve had Zoho One for almost 5 years and have always synced our emails from Gmail via IMAP… As of late, we’ve run into issues with our emails not syncing, due to being over the 10GB storage cap… What’s very odd is that we haven’t changed a thing? I know
        • Zoho Projects Android and iOS app update: Mobile device permission based on user profiles

          Hello everyone! We have brought in support for mobile device permissions based on the user profiles which are configured in organization level. Administrators can now configure the permissions on the web app(projects.zoho.com) by following the steps mentioned
        • Good news! Calendar in Zoho CRM gets a face lift

          Dear Customers, We are delighted to unveil the revamped calendar UI in Zoho CRM. With a complete visual overhaul aligned with CRM for Everyone, the calendar now offers a more intuitive and flexible scheduling experience. What’s new? Distinguish activities
        • How to import data from PDF into Zoho Sheet

          I am looking to import Consolidated Account Statement (https://www.camsonline.com/Investors/Statements/Consolidated-Account-Statement) into zoho sheet. Any help is appreciated. The pdf is received as attachment in the email, this document is password
        • Multi-currency and Products

          One of the main reasons I have gone down the Zoho route is because I need multi-currency support.  However, I find that products can only be priced in the home currency, We sell to the US and UK.  However, we maintain different price lists for each. 
        • Unlocking New Levels: Zoho Payroll's Journey in 2025

          Every year brings its own set of challenges and opportunities to rethink how payroll works across regions, regulations, and teams. In 2025, Zoho Payroll continued to evolve with one clear focus: giving businesses more flexibility, clarity, and control
        • Zoho Projects Android and iOS app update: Timesheet module is now renamed as 'Time Logs', delete option has been renamed to 'Trash'.

          Hello everyone! We have now renamed the Timesheet module as Time Logs and the delete option as 'Trash' on the Zoho Projects Android and iOS app. Time Logs Android: Time Logs iOS: Trash option Android: Trash option iOS: Please update the app to the latest
        • Zoho Mail app update: Manage profile picture, Chinese (Traditional) language support

          Hello everyone! In the latest version (v3.1.9) of the Zoho Mail app update, we have brought in support to manage profile picture. You can now set/ modify the profile picture within the app. To add a new profile picture, please follow the below steps:
        • Reminders for Article Approval

          Is there a way to send reminders for approvers to review articles and approve/deny them? I'm not seeing that option anywhere.
        • To print Multiple delivery notes in batches

          In Zoho Books, we can print a Delivery Note from an Invoice using the Print Delivery Note option, but it is non-editable and always prints all line items from the invoice. Our requirement is to deliver invoiced items in batches and print delivery notes
        • Notes badge as a quick action in the list view

          Hello all, We are introducing the Notes badge in the list view of all modules as a quick action you can perform for each record, in addition to the existing Activity badge. With this enhancement, users will have quick visibility into the notes associated
        • Add Full-Screen Viewing for Quartz Recordings in the Client Interface

          Hi Zoho Team, We would like to request an enhancement to the Zoho Quartz client interface when viewing submitted recordings. Current Limitation: When viewing a Quartz recording from the client (user) interface, there is currently no option to switch the
        • 2025 Recap: A Year to Remember | Zoho Inventory

        • Important Update : Pipedrive deprecated fields no longer supported in Zoho Analytics

          Dear Pipedrive users, We would like to inform you about a recent update related to your Pipedrive integration with Zoho Analytics. The Pipedrive team has deprecated certain fields from their application. You can find more details in the official Pipedrive
        • Product Updates in Zoho Workplace applications | November 2025

          Hello Workplace Community, Let’s take a look at the new features and enhancements that went live across all Workplace applications this November. Zoho Mail Format comments easily using Slash Commands With Slash commands, you can easily format text, insert
        • Right-Click Pipeline to Open in New Tab

          Please add the ability to right-click on a pipeline to open it in a new tab
        • Adjusting Physical Inventory

          Not getting very far with support on this one, they say they are going to fix it but nothings happened since November. Please give this a thumbs up if you would like to see this feature or comment if you have some insight. Use Case: Inventory set to be
        • Power up your Kiosk Studio with Real-Time Data Capture, Client Scripts & More!

          Hello Everyone, We’re thrilled to announce a powerful set of enhancements to Kiosk Studio in Zoho CRM. These new updates give you more flexibility, faster record handling, and real-time data capture, making your Kiosk flows smarter and more efficient
        • How to install Widget in inventory module

          Hi, I am trying to install a app into Sales Order Module related list, however there is no button allow me to do that. May I ask how to install widget to inventory module related list?
        • Deluge date time issue

          The deluge function info zoho.currentdate.toString("MMM/YYYY") returns Dec 2026 instead of 2025
        • Sending automated messages that appear in the ticket's conversation thread

          Good morning, esteemed Zoho Desk community, warm greetings Today I am here to raise the following problem, seeking a solution that I can implement: I need to implement an automation that allows me to send reminder messages to customers when I am waiting
        • Issue with Zoho Creator Form Full-Screen View in CRM Related List Integration

          Hi Team, We have created a custom application in Zoho Creator and integrated it into Zoho CRM as a related list under the Vendor module, which we have renamed as Consignors. Within the Creator application, there is a form named “Pickup Request.” Inside
        • Set connection link name from variable in invokeurl

          Hi, guys. How to set in parameter "connection" a variable, instead of a string. connectionLinkName = manager.get('connectionLinkName').toString(); response = invokeurl [ url :"https://www.googleapis.com/calendar/v3/freeBusy" type :POST parameters:requestParams.toString()
        • sync views to sheet

          Im looking to sync my views aka reports in analytics to zoho sheets, when data is updated in analytics it also should be updated in sheets, till now zoho sheets only offer raw data connection and it is not enough as these reports are difficult to re-do
        • How to update the Status in a custom module?

          Hi, I have a custom module "cm_payment_registry" in Billing, I am trying to change the status which is "Draft" with: array = {"custom_status":"Approved"}; zoho.billing.update("cm_payment_registry",organization.get("organization_id"), XXXXXXXXXXXXXX, array,"connectionname");
        • 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
        • Replace Zoho Invoice with QuickBooks

          We are implementing Zoho FSM for a cleaning business in the US with 50+ field workers. This business has been using Quickbooks for accounting for decades and will not migrate to Zoho Books. A major issue in the integration is the US sales tax calculation.
        • Reply and react to comments

          Hi everyone! We're excited to bring to you a couple of new features that'll make your sprint process simpler. A cloud application brings with it an array of social media features that can be efficiently used in your organizational setup. As an agile scrum
        • Possible to connect Zoho CRM's Sandbox with Zoho Creator's Sandbox?

          We are making some big changes on our CRM so we are testing it out in CRM's Sandbox. We also have a Zoho Creator app that we need to test. Is it possible to connect Zoho CRM's Sandbox to Zoho Creator's Sandbox so that I can perform those tests?
        • Send Supervisor Rule Emails Within Ticket Context in Zoho Desk

          Dear Zoho Desk Team, I hope this message finds you well. Currently, emails sent via Supervisor Rules in Zoho Desk are sent outside of the ticket context. As a result, if a client replies to such emails, their response creates a new ticket instead of appending
        • 2025 Highlights: A Year of Steady Progress and Significant Developments

          As we come to the end of 2025, let's take a moment to reflect on the significant progress and developments we've made to improve your travel and expense management. In the Spotlight Introducing Online Booking (US edition only - Early access) Enable online
        • Hide/Show Subform Fields On User Input

          Hello, Are there any future updates in Hide/Show Subform Fields "On User Input"?
        • Next Page