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 OAuth under Default Connection.
  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 



      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

          • 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

          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

                                  • Zoho Integration with UPS

                                    I have 2 questions: Firstly, is there a way to notify UPS that we have a package to collect once we have done the shipping label? Secondly, how do I get the tracking number and shipment method onto the Invoice and Package Slip for the customer? Than
                                  • Trigger action after workflow

                                    I would like to trigger a deluge function after the approval workflow is complete. Is this possible? The objective is to take the approved document and move it over to Zoho Contracts to send out to our customer for review and signature. The reason we
                                  • Why don't we have better integration with Mercado Pago or Pagseguro?

                                    Currently, the integration between Zoho Commerce and Mercado Pago for Brazil is very poor... Since it is old, it does not include the main payment method in Brazil today, which is PIX. Is there a date for this to finally be launched? There are numerous
                                  • Add a block or widget to Zoho Sites that allows users to create an interactive contact card with contact buttons (email, LinkedIn, website, etc)

                                    The proposed feature consists of a pre-designed, customizable block that displays a person's contact information (e.g., a speaker, sales representative, or independent professional) and offers quick access to: Email (icon with mailto: link) LinkedIn profile
                                  • Mapping a custom preferred date field in the estimate with the native field in the workorder

                                    Hi Zoho, I created a field in the estimate : "Preferred Date 1", to give the ability to my support agent to add a preferred date while viewing the client's estimate. However, in the conversion mapping (Estimate to Workorder), I'm unable to map my custom
                                  • Add the ability to view number of hours planned for a workorder while in the Dispatch Console

                                    Hi Zoho, When dispatching a work order through the Dispatch Console, there's currently no way to view the number of planned hours for the service tasks associated with that specific work order. Having to click into the details each time to check planned
                                  • Trigger for Validation Rules

                                    Currently in Zoho CRM we can set a trigger for workflows, blueprints etc in a custom deluge function But Validation Rules are missing For example if I run a custom function to update a record, it bypasses the validation rules It would be really beneficial
                                  • ZOHO Desk blocking emails from creating tickets

                                    Hi We have been noticing some issues since last week ZOHO Desk is not creating a ticket which is still in our affiliate mail box.
                                  • how to install desk

                                    how to install desk
                                  • How to turn off ability to share Knowledge-base article with social networks

                                    Is there a way to deactivate the link at the bottom of a Knowledge-base article so that it can not be shared via Facebook or Twitter?
                                  • Automatically Hide Unauthorized Sections from Agent Interface in Zoho Desk

                                    Hello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request regarding the user experience for agents in Zoho Desk who do not have permission to access certain sections of the system. 🎯 Current Behavior At present, when an agent
                                  • Is there a way to prevent a user from removing a payment method on a live, recurring subscription?

                                    As it stands, if you allow users to remove payment methods, they can do so on live subscriptions. This leaves the sub without a payment method. The user should be able to REPLACE the card with a new one, but not remove all payment methods. We have had
                                  • Client Script | Update - Introducing Subform Events and Actions

                                    Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
                                  • Is it possible to Bulk Update 'Product Name' in Zoho Desk?

                                    Is it possible to Bulk Update 'Product Name' in Zoho Desk? I cannot see that option now. Kindly help how we can do it.
                                  • Assistance Required: Report Export to Excel and WorkDrive Upload via Deluge

                                    I'm working on automating a scheduled workflow in Zoho Creator that needs to run weekly. The goal is to: Export a report from Zoho Creator in Excel (.xls or .xlsx) format, and Upload the exported file to a specific folder in Zoho WorkDrive using a Deluge
                                  • Kanban View for Projects.

                                    At our organization, we describe active projects with various statuses like "In Proofing" or "Printing" or "Mailing". In the Projects view, one can set these project statuses by selecting from the appropriate drop-down. While this works, it's difficult to view and comprehend the progress of all of your projects relative to each other in a table. Creating a Kanban view for projects where I can move them from one status to another allows me to see where each project is in the order of our workflow.
                                  • Zoho Projects - Q2 Updates | 2025

                                    Hello Users, With this year's second quarter behind us, Zoho Projects is marching towards expanding its usability with a user-centered, more collaborative, customizable, and automated attribute. But before we chart out plans for what’s next, it’s worth
                                  • Useful enhancements to Mail Merge in Zoho CRM

                                    Dear Customers, We hope you're well! We're here with a set of highly anticipated enhancements to the Mail Merge feature in Zoho CRM. Let's go! Mail Merge in Zoho CRM integrates with Zoho Writer to simplify the process of customizing and sharing documents
                                  • Send Whatsapp with API including custom placeholders

                                    Is is possible to initiate a session on whatsapp IM channel with a template that includes params (placeholders) that are passed on the API call? This is very usefull to send a Utility message for a transactional notification including an order number
                                  • How can I see the actual copy sent to the specific contact?

                                    I have setup a journey in Marketing Automation and created addition of contact in a specific list as the trigger, emails are sending to the contacts, but I can't see the actual copy sent to any specific contact in the list. Please guide me, where can
                                  • Client Script for Task Module

                                    When do we expect the client script for the tasks module?
                                  • Automating Employee Birthday Notifications in Zoho Cliq

                                    Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
                                  • 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
                                  • Product and Service

                                    Hi guys, there is a difference between layout of product and service if Long Description field have some kind of text. Please see screenshot 1 for Service here: https://prnt.sc/7xWwPKd29nWP for Product here: https://prnt.sc/LGmtVd_U6H7q As you can see
                                  • Create Project while winning potentials - Projects v3 api updated code

                                    Hi all, I've been using the built in function to create a project while a deal is closed won and noticed it had some missing fields when trying to reference the zoho projects v3 api documentation. Specifically the project group had some issues when adding
                                  • Formula Fields inside of Blueprint Transitions

                                    We would like to have formula fields inside of blueprint transitions. We type in currency fields and would like to see the result inside of a formula field. Our use case: Send out a price for XY 1. Filling out cost fields 2. See gross profit
                                  • Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups

                                    Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
                                  • ZOHOBOOK Sales_QUOTE: To Add Discount At Each Line Item Table

                                    Hi, Our quote need to display with discount at each line item level as well. Try to edit template, >CUSTOMISE>EDIT TEMPLATE> Table, I can see template view with discount column, but when hit SAVE the template, view in PDF the discount column not shown.
                                  • inventory based on bills and not physical stock

                                    Hello, I have noticed a very annoying issue with zoho books/inventory. I use composite items. If I have an sub assembly item on back order, I am unable to make up the composite item, even when I have received the goods and it is in my stock. I have to convert the PO into a BILL in order for the item to show as 'Accounting Stock'. The problem is that the supplier Invoice is not shipped with the goods, but can follow even a week later. So I have to make the bill have a 'dummy name and number' until
                                  • Using Zoho Inventory for managing Item compatibilities

                                    Use case: Using Zoho Inventory for managing (as an example) aftermarket car parts, where a single part can suit many makes, models and years. How do most businesses assign and manage compatibility for each part? Do ZI users typically do this using multi-select
                                  • Quoting Subscriptions with one Time costs

                                    Hello all, We sell a subscription SaaS service for which we provide one-time services for implementation and customization. Using CRM quotes i was able to create customized total fields to show the total one-time costs, monthly cost, total subscription
                                  • Unable to enter manual journal entries in AR/AP.

                                    Hi there, i am facing some problem relating to AR/AP. I want to make some entries in AR/AP through manual journal. for example. some time I send cash 500 to Mr. A (Customer) for any purpose and then after 2 or 3 days Mr. A returned back 700 to me and
                                  • Questions regarding WorkDrive

                                    Here are my questions regarding WorkDrive: Does WorkDrive have a limit on the number of downloads? What will happen if a file is downloaded excessively? Does WorkDrive have any restrictions on download speeds? Are there any limitations on downloading
                                  • How to record tips from customers

                                    I run a cleaning service business and on occasion customers include a tip with their check payment. How can I record the amount paid for service and the tip separately? Any amount over the invoice is looked at as an overpayment and suggest a credit note
                                  • Multi-currencies in Zoho Books

                                    I'd like to request multiple currencies in Zoho Books. I have customers paying in USD, CAD, CNY. I need to bill customers in these currencies too. I can set up a base currency, and then set up a exchange-rate table to convert these currencies.
                                  • I want refund of Zoho standard subscription on WEB payment

                                    Hi, Kindly help to refund the WEB payment made on 13/07/2025 for Zoho standard annual subscription. I didn't find the software useful for my project. Regards
                                  • Is Conditional display of field(s) possible in a Canvas Customer Portal?

                                    Is Conditional display of field(s) possible in a Canvas Customer Portal? How?
                                  • How do I set users up to only send emails using org emails?

                                    We run marketing campaigns for multiple clients and strictly send emails using the official organization addresses provided by each client. However, we've encountered several instances where users unintentionally send emails from their own company accounts—a
                                  • Pick List Issues

                                    I have created a pick list that looks at a table in a sheet, it selects the column I want fine. Various issues have come along. The option to sort the pick list is simplistic, only allows an ascending alphabetical sort. Bad luck if you want it descending.
                                  • Automate Backups

                                    This is a feature request. Consider adding an auto backup feature. Where when you turn it on, it will auto backup on the 15-day schedule. For additional consideration, allow for the export of module data via API calls. Thank you for your consideration.
                                  • Next Page