Automation#35 : Auto-Add Comments under the Owner's Name in Tickets via Macros

Automation#35 : Auto-Add Comments under the Owner's Name in Tickets via Macros


Hello Everyone,
This week's custom function provides simple steps to configure a Macro for adding comments to tickets with the name of the Comment owner.
When managing tickets, you can use the Comment feature to communicate internally with your team and keep everyone updated. If you select Comment(Private), the information will only be visible internally within your Zoho Desk. If you choose Comment(Public), the comment will be visible to your customers on the Help Center.

While automating comments using Macros, it can be challenging to track progress or identify the comment owner if no agent is attributed to the automated entry. This custom function ensures that the comment will appear under the name of the agent who applied it, rather than the person who configured the Macro.
 
Additionally, this Macro allows you to include a standardized comment to save time for frequently repeated updates.  
For example, Zylker Techfix collaborated across multiple departments and often required detailed customer information before transferring tickets between teams. They used comments to inform colleagues about the ticket status. To streamline this process, they automated a frequently used comment: "Awaiting additional information from the customer to proceed further." This clearly communicated to team members why a ticket was on hold. Additionally, this custom function allowed them to track which agent who applied the Macro.
To configure this within your Macros, please follow the steps below.

Create a connection

  1.1 Go to Setup(S) and choose Connections under Developer Space.
  1.2 Click Create Connection.
  1.3 Select Zoho Desk under Default Services.
  1.4 Set the connection name as deskconnection.
  1.5 Under Choose Scopes, choose the below scope values:
Desk.basic.READ
Desk.settings.READ
Desk.tickets.UPDATE
  1.6 Click Create and Connect.
  1.7 Click Connect.
  1.8 Choose the Desk's organization to connect with Deluge, and click Submit.
  1.9 Click Accept.
Connection is created successfully.

Configure Custom Function within the Workflow Rule

1. Go to Setup, choose Macros under Automation.
2. Under Macros, click Create Rule.
3. Check if the right department is selected
4. Under Basic Information, give a Rule Name and Description.
5. Under Availability, select All agents/Specific Agents based on your requirement. If you choose Specific Agents, select the agents for whom you want to make this Macro available. Click Next.
6. Under Actions, click on the drop-down in the + icon and select Custom Functions >> New.
    6.1 Under Basic Information, enter Name and Description. Choose Tickets under Module.
    6.2 Under Argument Mapping, give a desired Method Name. Map the arguments as below:
        6.2.1 In the Argument Name field, type ticketId and select Ticket Id in the Tickets Section.
 7. 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. commentContent = "<<Your_comment_content>>";
  5. // ----<<<< Initial Configs >>>>----
  6. logs = Map();
  7. ticketCommentParam = Map();
  8. loginUserEmail = zoho.loginuserid;
  9. logs.insert("ticketId": ticketId);
  10. logs.insert("loginUserEmail": loginUserEmail);
  11.  
  12. //---------------------------
  13. try {
  14.     // ---- start your logic from here ----
  15. agentDetailsResponse = invokeurl
  16. [
  17. url :deskURL + "/api/v1/agents/email/" + loginUserEmail
  18. type :GET
  19. connection:"deskconnection"
  20. ];
  21. logs.insert("agentDetailsResponse":agentDetailsResponse);
  22. if(agentDetailsResponse != null && agentDetailsResponse != "" && agentDetailsResponse.size() > 0 && agentDetailsResponse.containKey("id"))
  23. {
  24. agentId = agentDetailsResponse.get("id");
  25. ticketCommentParam.insert("commenterId":agentId);
  26. }
  27. // ---- Add comment in the ticket ----
  28. ticketCommentParam.insert("content":commentContent);
  29. ticketCommentParam.insert("isPublic":"false");
  30. ticketCommentParam.insert("contentType":"html");
  31. logs.insert("ticketCommentParam":ticketCommentParam);
  32. commentAddResponse = invokeurl
  33. [
  34. url :deskURL + "/api/v1/tickets/" + ticketId + "/comments"
  35. type :POST
  36. parameters:ticketCommentParam.toString()
  37. connection:"deskconnection"
  38. ];
  39. logs.insert("commentAddResponse":commentAddResponse);
  40. }
  41. catch(errorInfo) {
  42.     logs.insert("errorInfo": errorInfo);
  43. }
  44.  
  45. info "logs: \n" + logs;
  46.  
  47. if(logs.containKey("errorInfo"))
  48. {
  49.     throws "Error happen in the CF execution";
  50. } 
Notes
Note
a. In Line 3, replace .com in the address with .in/.eu/.ca based on your DC.
b.In Line 4, enter the text which you would like to include as a ticket. 
8. Click Save to save the custom function.
9. Click Save again to save the Macros.


We hope this custom function helps streamline your team's communication and enhances your ticket management process. If you have any questions or need further assistance, feel free to reach out to us at
support@zohodesk.com .
Regards,
Lydia | Zoho Desk 



      • 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

        • Personalize Email Campaigns using CRM Data

          Recently, few of our CRM users wanted to send an email campaign with personalized sender details and signature so that recipients can instantly recognize the sender. We are happy to announce the new enhancement in campaign creation through which you can personalize your email campaign using CRM Contact/Lead Owner's data. Let’s see how we can use those data to send emails.   Personalize sender details Using Zoho Campaigns, you can send an email campaign with a personalized sender name and email address
        • 集めて終わりにしない。― Zoho FormsからCRMへデータをつなぐ

          ユーザーの皆さま、こんにちは。ゾーホージャパンの友田です。 Zoho Formsで問い合わせや資料請求を受け付けた後、その情報をどうしていますか? 例えば、 フォームから届いた氏名や会社名、メールアドレスを確認して、Zoho CRMにも同じ情報を入力している。 そんな作業が発生している場合、FormsとCRMをつなぐことで、その手間を減らせるかもしれません。 Formsに入力された情報をCRMへ Zoho Formsは、Zoho CRMと連携できます。 例えば、Webサイトから資料請求を受け付ける場合、
        • Sheet co-edit: no live presence — also on Collaborate demo?

          Two Sheet co-edit sessions open OK (same document_id, document.edit: true), but there’s no real-time collaboration: no cell highlights, Group Chat → Users stays empty. Writer co-edit works on the same Office Integrator setup. We see the same on the official
        • Short product videos on Zoho Commerce product pages: what works?

          Short product videos are becoming a normal part of online store pages, and I have been thinking about how to use them well on a Zoho Commerce store. A few points that seem to matter: Keep them short. 6 to 15 seconds showing the product from a few angles
        • How to embed Google Analytics GA4 tracking on a standalone Public Page (outside Customer Portal)?

          Hi, Is there an official or recommended way to embed Google Analytics (GA4) tracking directly onto a standalone public Zoho Creator Page (outside of a Customer Portal)? I’m considering using an invisible Custom JS Widget as a workaround, but I’d love
        • Unable to integrate Whatsapp Messaging into Zoho CRM - Business Messaging

          Hello, I want to set up Business Messaging in our Zoho CRM and am struggling to set it up. I have logged into the account and our facebook business page, our business shows in the dropdown for WhatsApp Business Account but does not for WhatsApp Business
        • Zoho CRM calendar merge with outlook

          Hi Zoho team! I did the steps for syncing the zoho CRM calendar with outlook. Everything works well as long as the user creates meetings inside the newly created Zoho CRM calendar in outlook, but I need a way to also display the meetings which are received
        • Thunderbird cannot authenticate Zoho on android

          I keep getting a message from Thunderbird on Android that it could not authenticate for my account, dadashton@zoho.com., and to update my server settings. Now the settings are exactly the same for my other devices (1 Windows, 1 Mac and 2 Linux) Can anybody
        • Bills import rejects the Account column (The account does not exist), although the accounts exist in the Chart of Accounts

          Hello Zoho Books Team, I am unable to import bills into my Zoho Books. The import keeps rejecting the Account column, even though the accounts exist and work when I create a bill manually. What I am doing Bills > Import Bills, CSV/XLSX file, 145 rows,
        • How do I reorder the item table columns in my invoice template?

          There must be a way I just cannot find it. Anyone?
        • Zoho Desk API returning 403 SCOPE_MISMATCH for Ticket Search API

          Hello Zoho Support Team, We are experiencing an authorization issue with the Zoho Desk Ticket Search API. Our integration was working correctly yesterday, but we are now receiving the following error when calling the Search Tickets endpoint: API: GET
        • Free webinar: Zoho Sign in Q3 2026

          Hi there! From smarter signing on your Apple devices to new ways to verify and personalize your documents, Zoho Sign had a busy Q3—and we're bringing it all together in one session. Join us for a complete walkthrough of everything new this quarter, plus
        • Zoho Desk - Delete an email conversation

          When using Zoho support desk I see an option to delete and edit conversations that are comments, BUT if the conversation was automatically added as a conversation from an email, then the option to delete it seems not to be available. Is there a way to
        • Messages do not open and I cannot reply to messages in Zohodesk

          Hi, this is an unusual behaviour. I cannot reply to messages: Accessing a draft message - runs endlessly. Sending Emails fail:
        • Link item in purchase order to Customer

          Is it possible to link each item in purchase order to a customer which would create an associated list, so I can easily find where, when and what my customer have order from us. Thanks!
        • Passing the CRM

          Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
        • I want to test some payment subscription with a test credit card from stripe

          I have a test customer and place https://stripe.com/docs/testing#international-cards test credit card number to the Add New Card in subscription.zoho customer page. After I added, the test card was declined. Am I missing something?
        • This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details

          Hello, Just signed up to ZOHO on a friend's recommendation. Got the TXT part (verified my domain), but whenever I try to add ANY user, I get the error: This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details I have emailed as well and writing here as well because when I searched, I saw many people faced the same issue and instead of email, they got a faster response here. My domain is: raisingreaderspk . com Hope this can be resolved.  Thank you
        • Strengthen your account security with Password Policy

          Still using the same password for all your accounts? Or perhaps your password is easy to guess or follows a predictable pattern? If so, your account could be at risk. Once someone gets hold of a password that you reuse, they could potentially gain access
        • Expanding sales, marketing, and support capabilities in Zoho CRM Plus 3.0

          Hey everyone, It's been more than 10 years since we launched Zoho CRM Plus back in 2014. This is quite a milestone, and we've come a long way in empowering you with everything you need to offer an exceptional customer experience. On that note, we expanded
        • Introducing PRM: Build, manage, and scale your partner ecosystem

          Growing a partner ecosystem is a good problem to have. What starts as a handful of partners can quickly turn into a maze of spreadsheets, emails, and disconnected processes. More partners mean more opportunities, greater reach, and new ways to grow
        • Live connection to DS files in Zoho Creator / ChatGPT

          As an idea, we are using ChatGPT to build with Zoho Creator (outside of Zia), which is works brilliantly to assist write deluge, provide test suggesitons etc. Currently we are uploading the DS files which are very point in time, it would be great to have
        • Zoho Forms - Feature Request - Embed iFrame or Dynaic URLs in Description fields

          Hi Zoho Forms team, I'm working with a client who uses Zoho Forms internally to collect information over the phone from potential work placement candidates. At the end of the form, the candidate needs to be booked in for an induction, which we've configured
        • New in Office Integrator: Add text, diagrams, and drawings to your spreadsheet

          Hi users, We are pleased to introduce the Shapes feature in Zoho Office Integrator's spreadsheet editor. It lets users create visual elements; including simple shapes, text boxes, freehand drawings, and structured diagrams; directly within the spreadsheet.
        • Highlight what matters, erase what doesn’t in PDFs

          When reviewing PDFs or preparing them for sharing, two things often come up: you want to draw attention to what’s important, and you want to hide what isn’t. Zoho PDF Editor gives you both capabilities in one place with its highlight and erase tools.
        • WorkDrive Desktop Sync Is Being Deprecated: Move to WorkDrive TrueSync for a Smarter Experience

          Hi everyone, We are excited to share a better, smarter way to access and manage your files directly from your computer! We’re transitioning from our legacy Desktop Sync app to WorkDrive TrueSync, designed to give you faster performance,greater flexibility,
        • 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()
        • Introducing the Zoho Campaigns MCP server

          Hello everyone, We are pleased to announce that Zoho Campaigns is now available in Zoho MCP. You can now connect your Zoho Campaigns organization to AI tools such as Claude, ChatGPT, GitHub Copilot in VS Code, and Cursor, and manage your email marketing
        • SubForm Custom Sort - Deluge Workflows

          I have been experimenting with the Custom Order function of Subforms, it works beautifully within the subform itself and retains the sorting order. However, I need to be able to iterate through the records in Deluge using the sort order (The usage case
        • Bank feeds automation is broken - requires manual intervention and authentication

          Yodlee supports Australian Open Banking CDR protocols natively, but Zoho Books' implementation is still triggering legacy screen-scraping MFA blocks on CBA and other business banking accounts. When will Zoho update its Australian bank feed pipeline to
        • Cannot Access Subform Display Order in Deluge

          As highlighted in this community post, we still have to deal with the significant limitation of not being able to access the user-sorted order of subform rows through Deluge. This creates a major disconnect between the UI capabilities and backend automation,
        • Process FOR loop for subform items in the order of the manual sorting

          Hi Guys, I have searched everywhere and tried everything, but I still not able to resolve one particular challenge. I have a subform in my Invoice with rows for each item. I made it so that we can change the order of the items manually. I need to be able
        • Augmenting subform capabilities

          Greetings, everyone! Finally, the day has come for us to announce some of the most anticipated, requested, and exciting updates to subforms in Zoho Creator. As you're aware, subforms are an integral part of Creator forms, as they help in establishing
        • Build appointment scheduling into your vibe-coded apps with Zoho Bookings

          Exploring vibe coding? Wondering how an app built with AI can handle appointment scheduling? Join our upcoming live webinar to discover how Zoho Bookings APIs can help connect applications to scheduling capabilities. Here's what we'll explore: • Show
        • Is there a way to make Reason For Loss field mandatory at Closed Lost stage?

          Hi guys, Reason For Loss system picklist appears on Verify Details page but it is not mandatory so as a result, AEs tend to omit it (leave at default value -None-). Is there a way to make it mandatory at Closed Lost? I tried layout rule but this field
        • How to customize the displayed name of contacts in Trident?

          Hello, For work purposes, I sort different customers into different folders, and I also change their display names in Contacts so I can easily recognize them later. However, Trident doesn’t seem to support this. Even after I edit a contact’s name in Contacts,
        • User and mailbox reports in Zoho Mail: Review account status, storage, and login activity of users

          Administrators often need answers to questions such as which users have never logged in, whose storage is almost full, or which mailboxes are accessed through POP or IMAP. The User and Mailbox reports in the Zoho Mail Admin Console provide these details
        • ZOHO CRM APP - SALESINBOX

          Is it possible to access SALESINBOX in the CRM MOBILE APP
        • Zoho mail always free not showing up for me

          Im in the Australian data centre region
        • Tip #96 – See more of the remote screen with Virtual Monitor – 'Insider Insights'

          Hello Zoho Assist Community! Say you're supporting a device that has no monitor attached, like a server in a closet or a kiosk PC. You connect, and the screen is tiny, blurry, or distorted. Text overlaps and windows end up in odd places. Troubleshooting
        • Next Page