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

    Nederlandse Hulpbronnen


      • Recent Topics

      • Automation #7 - Auto-update Email Content to a Ticket

        This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk. Email is one of the most commonly
      • ZOHO TEAM INBOX Calendar Integration

        The Problem: Clients send meeting invitations to our TeamInbox address. TeamInbox receives these invites, but we cannot accept them. We do not use individual inboxes for transparency purposes. Ideal Solution: A way to accept calendar invites sent to our
      • filter broke my data

        I uploaded a file recently from Sheets and it has top 2 rows frozen, with table headers in second row and each one is filterable. somehow my first 2 columns became unfiltered and no matter what I do I cannot reapply the filter?? also didn't realize they
      • Introducing the Workflow and Actions APIs for Zoho CRM

        We are absolutely thrilled to announce the release of Workflow APIs and Actions APIs in Zoho CRM’s v8 API suite! This powerful new set of endpoints gives developers unprecedented programmatic control over business automation. For years, Workflow Rules
      • Adding anchor links in Zoho CRM email templates

        I know you can add anchor link in Campaigns, but I dont see the option to that in the CRM email template.  Am I missing something?  
      • How to apply customized Zoho Crm Home Page to all users?

        I have tried to study manuals and play with Zoho CRM but haven't found a way how to apply customized Zoho CRM Home Page as a (default) home page for other CRM users.. How that can be done, if possible? - kipi Moderation Update: The option to mark a customized
      • Zoho CRM Analytics - Allow To Reorder Dashboards

        I would like to suggest that you add the ability to reorder dashboards in the Analytics Module. I can see that this has been requested some time ago, the latest 9 years ago. I am not sure if this is a big or small endeavor, but such a small fix can go
      • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

        Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
      • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

        Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
      • Zoho Form URL displays incorrect name

        Hi, I have a form I created called "Design Request form". It displays this way everywhere I look. However, in the URL, it shows up as "DesignJobRequestFormFINAL011325PROOFV1B" and I'm not sure why. I can't find where to fix this. Does anyone have any
      • Consumers are talking about your business. Are you listening?👂

        A loyal customer might be praising your product in a forum. A frustrated user could be posting a harsh review on a public site. An excited partner may have left a comment on your campaign. A domain expert might be deconstructing your product. A prospect
      • What counts as a Temp for Billing Purposes in Workerly

        I'm considering trying this product but am not sure how the temp count is used for billing purposes. For example, if we keep a large data base of 500 potential workers.....are we billed for that or only if they are assigned to a client at a given point
      • Unable to Receive Emails on Zoho Mail After Office 365 Coexistence Setup – Error: 553 Relaying Disallowed

        Hello, My domain name is bigniter.com, and I’ve been using Zoho Mail as my email service provider without any issues. Recently, I followed the steps outlined in the Zoho documentation to enable Coexistence with Office 365: 🔗 https://www.zoho.com/mail/help/adminconsole/coexistence-with-office365.html#multi-server
      • Form name incorrectly displayed in URL

        Hi, I have a form I created called "Design Request form". It displays this way everywhere I look. However, in the URL, it shows up as "DesignJobRequestFormFINAL011325PROOFV1B" and I'm not sure why. I can't find where to fix this. Does anyone have any
      • I can't receive mail

        Hello, I can't receive e-mail. I no longer receive e-mails to the e-mail I received for ​my site. I also edited the DNS settings, but it doesn't work at all.
      • 1‑to‑1 invite missing post-setup (needs re-invite) vs channel invite auto-joins without business prompt

        1. Zoho Cliq 1‑to‑1 external invite The inviter sent a 1‑to‑1 invite to an invitee who didn’t have a Cliq account. After the invitee completed account setup and created a business/organization, the website redirected them to Cliq, where they opened Cliq
      • 【開催報告】東京 ユーザー交流会 Vol.3 2025/10/17 Zoho サービスの活用促進を外部ツールとの連携で実現!

        ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 10月17日(金)に新橋で「東京 ユーザー交流会 Vol.3」を開催しました。ご参加くださったユーザーの皆さま、ありがとうございました! この投稿では、当日のセッションの様子や使用した資料を紹介しています。残念ながら当日お越しいただけなかった方も、ぜひチェックしてみてください😊 ユーザー活用事例セッション:Zoho Flowと決済システムの連携 あみろくの岡島さんに、Zoho サービスの活用事例として、Zoho Flow を活用した外部サービスとの連携事例をご共有いただきました。
      • received email opens in a new tab every time I log in

        as per the title: since about when I first made my email account, every single time Ive logged in to view my inbox, a new tab opens for an email I viewed once as if restoring a closed session. I thought I just didnt understand the "starting up" settings
      • Engage with your customers at scale using WhatsApp Marketing Template messages

        Hi everyone, To make it easier for organizations to communicate with customers, Desk now allows you to send individual, mass, and bulk WhatsApp template messages from both the Ticket and Contact modules. How is this going to benefit your business? WhatsApp
      • Zoho Desk iOS and Android app update: AI powered: Reply Assistance and Refine Messages on IM module.

        Hello everyone! We are excited to introduce new AI powered features on the IM module of the Zoho Desk app. Reply Assistance: Reply Assistance generates suggested responses for incoming chat messages, which you can directly insert into the conversation
      • Importation Tickets error

        Hi, I'm newbie here 🤓 So, i'm importing data from csv, but when I try advance to mapping fields the importer tool show this message: Previously I try import, other data, and not show errors in this step. Some ideas? Best Regards,
      • Missing information data Zoho inventory

        there some missing data in Zoho inventory connection. pick list stock counts bin location we have requested it via mail and the support team doesn’t gove feedback. has anyone achieve to get these info or to ask other ya les
      • Global Search placement in the new UI

        Having a hard time with the global search placement in the UI redesign. Surely I can't be the only one. Previously global search placement was perfect. A bar at the top/center of the page. Exactly where you would expect it to be. Since the new UI has
      • Showing description in timesheet and timelogs.

        I am wondering if it’s possible in version 5 of Zoho People to have the description show by default or with a manipulation on the user’s part. Let me show you what I mean. As you can see this is the view for the users. Now if they want to see the full
      • Direct “Add to Google Calendar” Option in Zoho Meeting

        Hello Zoho Meeting Team, Hope you are doing well. We would like to request an enhancement related to the “Add to Calendar” functionality in Zoho Meeting. Currently, when we open Zoho Meeting and view our meetings under My Calendar, there is an Add to
      • Support french language options

        Greetings, I want to use Zoho with the french language portal, however the supplied translation is not very good (google translate).  There are many basic mistakes on the main most important sections (my requests, submit a request). Is there a way for me to edit this, and if not, would you be willing to make the changes if I supply you with the correct translations? At least for the most glaring, important mistakes. I am a native french speaker. Thanks James
      • Add Flexible Recurrence Options for Meeting Scheduling in Zoho Cliq (e.g., Every 2 Weeks)

        Hello Zoho Cliq Team, We hope you are doing well. Currently, when scheduling a meeting inside Zoho Cliq, the recurrence options are limited to Daily, Weekly, Monthly, and Yearly. There is no ability to set a meeting to occur every X weeks — for example,
      • Sales Order, Invoice and Payment numbers

        Hi zoho friends, it is me again, the slow learner. I'm wondering if there is a way to have it so the Sales order, invoice and payment numbers are all the same? It would be easier for me if they were the same number so there is not so many reference numbers
      • Enhanced duplicate check for Leads in CRM

        Hello Everyone, We are excited to announce that you can now check for duplicate entries in leads by comparing them with similar records in the Contacts Module. Previously, when you added a lead, only the converted leads were checked for duplicates. This
      • Ability to Add YouTube Video to Playlist During Publishing

        Hi Zoho Social Team, How are you? While publishing YouTube videos through Zoho Social, we noticed that the platform currently does not allow selecting a playlist at the time of publishing. Instead, we can only add the video to a playlist after it has
      • Ability to Change Visibility of Published YouTube Videos

        Hi Zoho Social Team, How are you? We would like to request an enhancement in Zoho Social regarding the management of already published youtube videos. Currently, after publishing a youtube video through Zoho Social, there is no option to change its visibility
      • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

        The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Managing addresses
      • Ask the Experts 24: Analytics, data administration, and mobile experience with Zoho Desk

        Hello Everyone! Welcome back to the Ask the Experts(ATE) series! We were so focused on our Autumn 2025 release that we didn't host an ATE session last month. In this month's ATE, we'd like to expand our areas for discussion: we'd like to listen to your
      • Update on the client portal URL for Guest users

        We’re updating the way Guest users access their Connect network. As part of this change, all client organization portals used by Guest users will now be accessible through a dedicated domain specific to each data center. The access URLs mentioned here
      • Workaround: openURL in Blueprints - An alternate approach

        There is a roundabout way to open a URL in blueprints after a save event. By using the 'onBeforeMandatoryFormSave' in Client Script, you can open an external URL. Now, the problem is, this is designed to be run BEFORE the blueprint is saved, not after,
      • MTD SA in the UK

        Hello ID 20106048857 The Inland Revenue have confirmed that this tax account is registered as Cash Basis In Settings>Profile I have set ‘Report Basis’ as “Cash" However, I see on Zoho on Settings>Taxes>Income Tax that the ‘Tax Basis’ is marked ‘Accrual'
      • Migrate file from Single File Upload to Multi File Upload

        Dears, I have created a new field Multi File Upload to replace the old Single File Upload field. I'd like to ask you guys what is the best way to migrate the files to the new field?
      • Integration Request: Elementor

        Integrating Zoho CRM forms with Elementor, the most popular page builder on Wordpress, would be great. I use it for our site, goenergylink.com, and I have had to use Zapier webhooks to be able to connect it with Elementor. The one issue I have run into
      • Open "Live Chat" from a hyperlink?

        Hi, I often write paragraphs and text on our company website, and usually say you can get in touch with us via live chat. Can the chat window be triggered to pop open without clicking the chat graphic in the bottom window, and use it in a hyperlink? ie:
      • Zoho Sites search box

        Is there a Search box that can be added to a Zoho site? It would be for searching within the site only.
      • Next Page