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 


    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                                        • 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


                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner







                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

                                                                                          Writer is a powerful online word processor, designed for collaborative work.

                                                                                            Zoho CRM コンテンツ






                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • How to Delete Old Tasks/Streams Assigned by Deactivated Users? 'Operation Not Permitted' Error

                                                                                                          Hello, I’m using Zoho Mail and have several old tasks assigned to me in Tasks and Streams. These tasks were created by former employees whose accounts are now deactivated. When I try to delete these tasks, I get an "Operation Not Permitted" error. These
                                                                                                        • Profile date settings

                                                                                                          At present I have "EEE, MMMM dd, yyyy" but this takes an exessive amount of column space, we should be able to input our own format. I would like to use "EEE, MMM dd, yy" - a much shorter version of the above but with the same abbreviated info, requiring
                                                                                                        • Wich version of Backstage is included in Zoho One

                                                                                                          Hello I am in the event business and i am considering Zoho One to replace my current tools. I will need Backstage to manage my events but I am wondering wich version of backstage will I get if I subscribe to Zoho One. Thank you Guillaume
                                                                                                        • How to restore deleted campaigns?

                                                                                                          I accidentally deleted my first campaign that went out today (08/21/18). How do I restore it?
                                                                                                        • Organize and Clone Task Custom Views

                                                                                                          We have rolled out two new enhancements to task custom views: Custom View Groups and Custom View Clone. Custom View Groups Similar to predefined view groups, we have introduced groups for custom views to help organize and categorize them. My Custom Views:
                                                                                                        • 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
                                                                                                        • Stock Count History in Product Details – Zoho Inventory

                                                                                                          Hello Zoho Team, When I perform a Stock Count for a product in Zoho Inventory, I would like to view the history of those stock counts later — especially from the product details page. Currently, I can perform the count and update the quantity, but I’m
                                                                                                        • 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
                                                                                                        • 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.
                                                                                                        • Zoho Books CREDIT LIMIT is completely USELESS due to a BUG!!! Please fix it ASAP!!

                                                                                                          Credit Limit should not be taken into account if payment terms on the Invoice are without credit. If selected Credit 0 days (Prepayment) why in this world would a notification pop up saying credit limit is exceeded and not allowing to create an invoice?
                                                                                                        • Show item Cost value on Item screen

                                                                                                          The Item screen shows Accounting Stock and Physical Stock. It would be very helpful if value information could be displayed here as well, for instance Cost Price. Currently, to find the Cost Price (as used for inventory valuations) from inside the item
                                                                                                        • Show all items making up the composite item in transactions

                                                                                                          Dear Zoho, Currently, when we select a composite item in Zoho Inventory for a transaction, we do not receive a breakdown of the individual items that make up the composite. This makes it challenging for our team to accurately pick, pack, and ship the
                                                                                                        • Is it possible to adjust the web browser tab title (when a ZoHo Desk ticket is opened)

                                                                                                          Hi All, When I open a ZoHo Desk ticket in a web browser, the tab title (text that appears at the top of the browser tab) uses the logic: *company icon picture* (xxxx) #ticket number - company name See below (highlighted in red) for reference. Company
                                                                                                        • Configure ChatGPT in Zoho Cliq | Now with GPT-4!

                                                                                                          Updated for GPT-4 Support: The post and scripts has been revised to take advantage of the new GPT-4 model's capabilities. Please use the updated version for enhanced performance and accuracy. If you have been on the internet for the past few months, you
                                                                                                        • Editing the text on the Help Center home page

                                                                                                          Is it possible to edit the "Welcome to Help Center" message anywhere? This one: We'd like to be able to tailor it a little more ourselves.
                                                                                                        • Upcoming Changes to LinkedIn Parsing in Resume Extractor

                                                                                                          Starting 31 July 2025, the Zoho Recruit Resume Extractor will no longer support direct parsing of candidate data from LinkedIn profiles. Why Is This Change Needed? In accordance with LinkedIn’s platform policies, extracting profile data through browser
                                                                                                        • How to Initiate WhatsApp Message on SalesIQ?

                                                                                                          I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                                                                                        • Have completed Zoho Sign documents attach automatically to contact and/or account

                                                                                                          Hello, Just used ZohoSign for the first time to get an e-signature on an important document. Setting up the template was nice and easy and configuring the request to go to the right people and training a member of staff was also very easy. HOWEVER Why
                                                                                                        • Rich Text For Notes in Zoho CRM

                                                                                                          Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                        • "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."

                                                                                                          @Dr Saurabh Joshi @Haiku Technical Support @Ishwarya SG @Sparrow Hill President @Hugh Marshall "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."
                                                                                                        • Using email "importance" as workflow-criteria

                                                                                                          I'd like to set up a workflow that triggers if an incoming email has been flagged as "high importance" but I'm not seeing any way to do that. Hopefully I'm just missing something obvious...?
                                                                                                        • Send emails directly via Cases module

                                                                                                          Greetings all, The ability to send emails from the Cases module, which users have been eagerly anticipating, is now available, just like in the other modules. In Zoho CRM, Cases is a module specifically designed for managing support tickets. If your organization
                                                                                                        • Currency transition

                                                                                                          We are using Zoho CRM in Curacao, Dutch Caribbean. Our currency is currently the ANG. Curacao will be transition ing from using the ANG (Antillean Guilder) to using the XCG currency (Caribbean Guilder) on March 31st 2025, see: https://www.mcb-bank.com/caribbean-guilder.
                                                                                                        • Color of Text Box Changes

                                                                                                          Sometimes I find the color of text boxes changed to a different color. This seems to happen when I reopen the same slide deck later. In the image that I am attaching, you see that the colors of the whole "virus," the "irology" part of "virology," and
                                                                                                        • Update Lead Status in Zoho CRM When a Meeting is Booked via Microsoft Bookings

                                                                                                          Hi everyone, I’m trying to streamline our lead management process and would like to automatically update the Lead Status in Zoho CRM whenever a meeting is booked through Microsoft Bookings. Has anyone successfully implemented this kind of integration
                                                                                                        • How to link web sales payments through Stripe to invoices?

                                                                                                          I have just set up an online shop website which accepts payments through Stripe.  The payment appears in Zoho Books through the Stripe feed as 'Sales without invoices'.  In order to keep Zoho Inventory in step, I manually (for now) create a Sales Invoice
                                                                                                        • Zoho Website Site Speed Up & Setting

                                                                                                          We are experiencing slow loading speeds on our Zoho website and would like assistance in optimizing its performance. Kindly review the site and suggest or implement necessary improvements to enhance speed, especially related to: > Caching mechanisms >
                                                                                                        • Kaizen #199: FAQs on Multi-Select Lookup (MxN) Field in Zoho CRM

                                                                                                          Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone. Got
                                                                                                        • NFC Support

                                                                                                          Hi, I would like NFC Support like Zoho Creator, to pre-fill field values by scanning an RFID device. Zoho Creator NFC here: https://www.youtube.com/watch?v=F4JoMWnF82I Both on a Field's User Input (Mobile Apps), in additon to QR Code & Barcode today,
                                                                                                        • Zoho Desk Android app update: Enhanced UI of the History tab.

                                                                                                          Hello everyone! In the latest Android version(v2.9.10) of the Zoho Desk mobile app, we enhanced the UI of the 'History' tab within a ticket. Also, we have introduced a filter option to easily search the history based on the actions performed on the ticket.
                                                                                                        • UK Registration for VAT with existing stock/inventory

                                                                                                          We have an existing inventory of stock and are investigating how to handle the conversion from a UK VAT unregistered company to a UK VAT registered company. Enabling VAT registered status looks extremely easy, but we cannot find any way within Books to
                                                                                                        • Blueprint - Mandatory file upload field

                                                                                                          Hi, File upload (as we as image upload) field cannot be set as mandatory during a blueprint transition. Is there a workaround? Setting attachments as mandatory doesn't solve this need as we have no control over which attachments are added, nor can we
                                                                                                        • Is Zoho Marketing Plus part of Zoho One?

                                                                                                          Hi, Is the new fancy Zoho Marketing Plus part of the Zoho One package? Is there any benefit in using this rather than the standalone products? Many thanks Jon
                                                                                                        • 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.
                                                                                                        • 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
                                                                                                        • Change visable Subform fields

                                                                                                          I have a form with 4 subforms in it. I added another field to each of the subforms in my main form. Now, how do I update the subforms to show the new fields that I added?
                                                                                                        • Announcing Agentic AI - Ask Zia!

                                                                                                          We are delighted to roll out the new agentic AI capabilities in Ask Zia, where every stage of the BI workflow is assisted by AI. With a human-in-the-loop approach, Ask Zia ensures that you’re in command of the decision, while AI handles the complexity.
                                                                                                        • Integrate Bunq with ZOHO Bookes

                                                                                                          We are new users of ZOHO Books, and our bank (BUNQ, in the Netherlands) isn't listed on the bank integrations. Is there a way to handle this?
                                                                                                        • Trial Extenstion/ 2nd Go!

                                                                                                          Hi, Recently trialed FSM bit didnt get a chance to try out the most recent features is it possible to get another trial to try the new features and see if I can make it work for me?
                                                                                                        • Whatsapp BOT with CRM

                                                                                                          Hello, how do you use Whatsapp integrations in zoho CRM?
                                                                                                        • Next Page