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 


    • 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

      • Connection to Zoho One

        My org has a Zoho One account, which includes Zoho Social. We are wanting to try linkthread. However, I want to make sure it is set up properly from an account perspective, as I have accidentally created Zoho accounts separate from Zoho One when I didn't
      • Ticket Automatically Created from Closed Chat

        Is there a way to prevent a ticket being create for every chat.... or at the very least have it automatically closed.
      • IMPORT INVOICES CSV

        Hi, Impossible to import invoices in Zoho books with a csv file. I have also tried with the template. My topic keeps getting closed but I did not get any answer Is there an issue with this fonctionnality ?
      • Zoho Books | Product updates | July 2025

        Hello users, We’ve rolled out new features and enhancements in Zoho Books. From plan-based trials to the option to mark PDF templates as inactive, explore the updates designed to enhance your bookkeeping experience. Introducing Plan Based Trials in Zoho
      • An Exclusive Session for Zoho Desk Users: AI in Zoho Desk

        A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
      • Related Lists in Email Templates

        Hi Zoho team, I would love to see a feature where related list information can easily be added to an email template (instead of mail merge). I have a client who books flights for their customers. They do this through a Flights module so all booked flights
      • Zoho One - White Label

        Releasing a white-label feature for Zoho One, or any software or service, can offer several advantages and benefits for both the company providing the software (Zoho in this case) and its users. Here are some key reasons for releasing a white-label feature
      • Outlook plugin funktioniert nicht.

        DAs Outlook Plugin funktioniert nicht mehr. Ich werde aufgefordert, mich mit der App "OneAuth" anzumelden Intelligente Anmeldung per OneAuth funktioniert nicht zufreidenstellend. Nach erfolgreicher Anmeldungung mittels QR Code lande ich wieder beim QR
      • Can't get sender adress to work

        Hi, I am having some trouble getting the sender adress to work for responses on tickets. I would like to configure a sender adress that is different from the zohodesk emailadress that is normally used. These are the steps I have followed: 1. Add a new
      • iOS App Version 3.0 - Customer list gone?

        Not sure when this changed, but I seem to have been updated to 3.0 for the phone app (on iOS). I'm pretty sure that I used to have a Customers button that allowed me, for example, to see what appointments a customer has. Has this disappeared or am I just
      • Zoho Signature, "For Demo Purpose Only Powered by Zoho Sign"

        How to disable this text on the documents for signature. "For Demo Purpose Only Powered by Zoho Sign"
      • Add Resource variable to notification email customisation for Event Type

        The notification email customisation feature for Event Type does not include a variable for the Resource field. Without this field, Zoho Bookings cannot be used by any business for resource-based services or event types e.g. room bookings, equipment bookings.
      • Can't find add role button, is iet st because I have the free subscription

        Trying to add my accountant in Zoho Books if I press the add accountant button, I get stuck as it says no such role exists, and won't let me continue, I can't find the add roles button, so I am stuck. Is it because I have the free subscription? Also can't
      • Calendar view all appointments in workspace

        In the Calendar page, add the ability to view all appointments in the Workspace. The Manage Calendars filter requires me to select at least one user or resource, and it only lets me select up to five of them. There's no filter option to view the entire
      • Tip #13: Identify where your bookings come from with Source Tracking

        Source tracking is the practice of identifying where your bookings originated. This is important, because online bookings come from a wide variety of sources like social media platforms, your website, email and ad campaigns, partner websites, organic
      • MS Teams for daily call operations

        Hello all, Our most anticipated and crucial update is finally here! Organizations using Microsoft Teams phone system can now integrate it effectively with Zoho CRM for tasks like dialling numbers and logging calls. We are enhancing our MS Teams functionality
      • Unable to Add Notes

        I've had a user report that they are unable to add notes to account records. I attempted and found the same issue. There is no option to save the note.
      • Workflow Rule Alert Not Working

        I have a workflow rule set (that I've been using for years) that suddenly stopped working. Module - Leads Execute on - Create Alerts - Email Active - Yes When I create my lead I no longer receive my email notification. 
      • Unify Overlapping Functionalities Across Zoho Products

        Hi Zoho One Team, We would like to raise a concern about the current overlap of core functionalities across various Zoho applications. While Zoho offers a rich suite of tools, many applications include similar or identical features—such as shift management,
      • Zoho Recruit > Job Opening Module> Editing, Deleting, Adding (Fields)

        Hello All In the Job Opening Modules How do i go about deleting the Positing Title or changing to Job Title or can i hide it from all? I want to add a Look Up User Field, however when i select the look up field i do not see that Can i have the industry
      • Assignment Thresholds Resetting After Lead Conversion

        Hello everyone, We're facing an issue with Zoho CRM's lead assignment thresholds that makes them unsuitable for our workflow. I'm hoping to find a potential workaround or solution from the community. Here’s our current process: A new lead is created automatically
      • Personal Link / Meeting ID

        with zoho meetings do I have my own personal link to my 'meeting space' ? I have an email template in Zoho CRM which confirms people's appointment with me, I would like to include the link to my Zoho Meetings so that they have it in advance. How do I
      • Help Needed with Creating Close % Reporting

        Now that our company has a good data set to work with we want to use ZCRM reports ways to track the performance metrics we have established. Specifically, I want to be able to calculate closing % for individual salespeople and individual support people.
      • Assistance Required: Authentication Error When Sending Credit Application Form

        Hi, I'm encountering an error message that states: "Authentication unsuccessful – the user credentials were incorrect." This occurs when I attempt to send the credit application form to our customers. I've attached the form I’m trying to send for your
      • Can zoho sign collect data feeding Zoho Sign?

        I m sending contracts to client who are not in my zoho CRM database yet. Can the data they enter in Zoho sign contract I send them, (that includes...) official company name address first name second name etc, ...Create or update a contact / account
      • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

        Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
      • 6 time-saving tips for working with tables in Zoho Writer

        Tables have always been the best way to represent data. They help you structure and categorize information systematically and present them in a simpler way. While tables in Zoho Writer are easy to implement, some tasks might not be that obvious.  Here are some time-saving tips to help you work better with tables in Zoho Writer:    1. Insert Multiple Rows / Columns in a Table Adding more rows and columns is the most common action performed while working with tables. Instead of using the Table tab,
      • Modified approved time log

        I can’t seem to find a way to make change to approve time log entry. The case is the following. We pay the employees every 2 weeks, so employe A enter is time for the 2 weeks and then submit his timesheet. Now is superior approve the time he worked via
      • Question Regarding Deleted Reports in Zoho Desk Analytics

        Dear Zoho Desk Support Team, I hope this message finds you well. We have a question regarding the Analytics module in Zoho Desk, specifically related to deleted reports/dashboards. We would like to understand the following: Is there a recycle bin, recovery
      • Making money out of Zoho Sheets - How?

        Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
      • Adding Columns to Reports

        Hi, Is it possible to choose fields to be added as columns in the reports? Thank you.
      • The use of Ticket statuses

        When your support team mark a ticket "Closed" before I had a time to check what your team has done on the ticket - I have to consider this as you consider the ticket closed even if I dont consider it closed. Which automatically produce a negative sentiment.
      • Formatting of cells changing by itself and formulas not always calculating automatically

        I'm new to Sheets and have been setting up a budgeting template that has many linked tabs. It's going fairly well except certain quirky things have been happening from time to time. 1- sometimes when I scroll up or down I lose formatting from a random
      • Sudden Layout Issue After Last CSS Update for ZML (Temporary Fix Inside)

        Hi, Our clients have noticed today that every section laid out with ZML suddenly shows an unwanted top padding/blank space that interrupts the user screens. It appears that Zoho has changed the default CSS for the .zcp-col.zcp-panel-rowtype-auto element.
      • What are people using to send Service based emails?

        Zoho Campaigns is for marketing. Users can unsubscribe from these emails. Service based emails need to be delivered and can without the worry of Can-spam act. What are people using to send service based emails? My mailing list is derived from a database
      • Client Script also planned for Zoho Desk?

        Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
      • Introducing Zoho Commerce 2.0 — It's more than just selling!

        Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
      • Missing Fields in Lead Conversion Mapping

        I’ve been using Zoho CRM since 2013 to manage leads and convert them into contacts and jobs. When I convert a lead to a customer, I create a new contact and a job. Previously, this process automatically transferred key information from the lead to the
      • Kits: Option to Hide Associate Items on Documents

        The new Kit type of Composite Item is very helpful, and we're already using it in several different ways. One problem is that there seems to be no way to hide the components on some documents, including Package Slips. There is an option given in settings
      • Unable to display field label from a hidden Single Line Textbox in Description

        Hi folks, I'm unable to display my hidden field, e.g. ${zf:SingleLine4} , in my description. I'm pre-filling this hidden Single Line Text box via "Field Alias - Pre-fill URL" settings. I noticed that my decimal form fields work, e.g. ${zf:Decimal}, and
      • Next Page