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

                                                                                                        • Payment Schedule

                                                                                                          Please add the ability to create a payment schedule. The other options, like retainer invoices or two invoices, do not work for the customer.  We invoice a client and need to be able to show them everything they owe in one invoice, and when each payment
                                                                                                        • 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
                                                                                                        • Product Details's Description is lost

                                                                                                          Hi CRM lost its description in Product details subform. Can you make some test before deploy any update?
                                                                                                        • 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
                                                                                                        • メール一括配信の未送信のメールについて知りたい

                                                                                                          メール一括配信の後の、未送信のメールの数は添付のようにシステムから連絡がくるのですが それらの対象者を知りたい。レポートなど一覧で知りたい。 また配信対象者なのに(担当者、リード)の メールの履歴に配信したメールの件名でさえ表示されないのはどう理解したらよいのか知りたいです。 また、これらの人をレポートで一覧で出す方法を教えてください。把握したいためです。
                                                                                                        • Zoho Bookings Issues We are facing

                                                                                                          Hi team, Here are list of issues we are facing with Zoho Bookings when migrating from other platforms. Sorry there is a lot but the bookings app need to be functional and practical for people to actually use it and not-cause MORE problems by being so basic and not customisable to each business.  1: SMS reminders for staff  There should be time limits on these reminders to make them useful. EG. if a new booking comes in more than 4 hours from now we don't really need to get a reminder, however if
                                                                                                        • Booking outside of scheduled availability

                                                                                                          Is there a way for staff (such as the secretary) to book appointments outside of the scheduled availability? Right now to do this special hours must be set each time. There should be a quicker way. Am I missing something?
                                                                                                        • Run workflow on data import in Creator 6

                                                                                                          How to run a workflow on data import in Creator 6?
                                                                                                        • Add Resource to Export

                                                                                                          The Export Data feature does not include a column for the Resource field. Without this column, Zoho Bookings cannot be used by any business for resource-based services or event types e.g. room bookings, equipment bookings. It seems to be an oversight,
                                                                                                        • Multi Day booking for resources

                                                                                                          I have following business-case: Rental for Tablets. Customer should be able to select how many device for how many days he'd like to rent. Same as a car rental for multiple days. Is this possible with Bookings on the current version?
                                                                                                        • Sales IQ - Bot Builder - Forward to Operator Action Card Improvement

                                                                                                          Hi team, It would be a great improvement to have an additional branch out of the Forward to Operator Action Card. I would like to allow 10 seconds for an operator to pick up the chat, if they don't or if they reject the chat I would like the Bot to continue
                                                                                                        • Zoho AI Translate Task as Rest API

                                                                                                          I cant find any docs on how to use Zoho AI Translate Task from a rest api call https://www.zoho.com/deluge/help/ai-tasks/translate.html I am working on a custom Widget and I dont think I can execute zoho deluge ai translate task from a custom widget.
                                                                                                        • Interactions Tab in Zoho CRM: A 360° Omnichannel View of Every Customer Touchpoint

                                                                                                          Hello Everyone, Hope you are well! We are here today with yet another announcement in our series for the revamped Zoho CRM. Today, we introduce Interactions Tab a new way to view all customer interactions from one place inside your CRM account. Customers
                                                                                                        • 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.
                                                                                                        • Custom Roles & Granular Permission Control in Zoho SalesIQ

                                                                                                          Hello Zoho SalesIQ Team, We appreciate the functionalities offered by Zoho SalesIQ, but we would like to request a crucial enhancement regarding user roles and permissions. Current Issue: At present, Zoho SalesIQ provides fixed roles—Admin, Supervisor,
                                                                                                        • 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
                                                                                                        • Add Usage & Voting Analytics for Knowledge Base Articles in Zoho SalesIQ

                                                                                                          Dear Zoho SalesIQ Team, We appreciate the current integration between Zoho Desk and Zoho SalesIQ that allows knowledge base articles to be synced and displayed to users directly within the SalesIQ chat interface. One valuable feature already available
                                                                                                        • Choice-based Field Rules on Global Lists

                                                                                                          Hi, The new Choice-based Field Rules should also be able to work with Global Lists not just local lists. Thanks Dan
                                                                                                        • Real-Time Alert or Status Indicator for WhatsApp Connection Issues in SalesIQ

                                                                                                          Hi Zoho Team, We’d like to request a feature enhancement in Zoho SalesIQ related to WhatsApp integration stability and visibility. Recently, we encountered a critical issue where our WhatsApp bot stopped responding to messages without any warning or alert
                                                                                                        • Customization of Chat Transcript Emails in Zoho SalesIQ

                                                                                                          Hi Zoho SalesIQ Team, I hope you're doing well. We would like to request the ability to customize the email template that is sent to clients when they request a chat transcript from SalesIQ. Currently, when a client clicks the button to receive their
                                                                                                        • Import from Linkedin

                                                                                                          Please provide a way to enable importing contact information for Contacts and Companies from Linkedin? Thanks
                                                                                                        • Books/Square integration with multiple bank accounts

                                                                                                          Hello, I need some workaround ideas! We have two parts of our business which have their own bank accounts and customers. We use 'locations' in Square to allocate the payments to the correct place and we use 'branches' in Zoho Books to define which transactions
                                                                                                        • 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
                                                                                                        • The ability to format text fields, ie when data is number or currency

                                                                                                          Hello, I have spent some time trying to determine how to accomplish this but it appears to be impossible. I want to merge a currency field from CRM into a PDF document. The CRM data shows $1,234, but when zSign gets the data it shows 1234 in the text
                                                                                                        • 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
                                                                                                        • Tip of the Week #64– Customize your sidebar for a more focused workflow.

                                                                                                          When your shared spaces start filling up with too many views, it gets a little harder to zoom in on what really matters. You find yourself scrolling more than working, and the things that need your attention? They’re often buried down below. Custom sidebar
                                                                                                        • Include EVERYTHING in Language Files

                                                                                                          Hey, we are building out a system, that needs to be translated. The language files lack a few things though. 1. Blueprint names 2. Canvas View elements like tab names 3. ... Please include everything into these files, otherwise it's not really a multi
                                                                                                        • Canvas: Add Sections to Detail View

                                                                                                          Currently it is only possible to add fields to a canvas detail view. This makes Canvas hard to maintain, because everytime we add a field to our system, someone needs to go into the canvas view and add it there as well. This leads to additional work and
                                                                                                        • 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
                                                                                                        • Zoho Social - Queries about GST invoices and subscription

                                                                                                          Hi, I am going to purchase the Zoho Social tool with a yearly subscription. So, can you please help me with my below queries: 1. How I get the monthly GST Invoices? 2. What is the process of subscription? 2. How to cancel a subscription?
                                                                                                        • Entire notebook that had notes has disappeared

                                                                                                          I don't know how tf this happened. All I did was uninstall and reinstall the mobile app after fixing a bug I had. After I reinstalled the app, everything was synced back except for one folder which had a bunch of notes in it. None of those notes are in
                                                                                                        • Add a Way to Duplicate Cards in the Same Canvas (Retain All Settings)

                                                                                                          Dear Zoho SalesIQ Team, We would like to request a new feature in Zoho SalesIQ: the ability to duplicate an existing card within the same canvas while retaining all of its information and settings, including conditions, configurations, and display preferences.
                                                                                                        • Sales IQ needs to capture both first and last names

                                                                                                          Sales IQ chat only has one field for name. When this then syncs with Campaigns, the field populates the "last name" field in Campaigns. However most people fill in the "name" field of Sales IQ with either their full name or their Christian name. This
                                                                                                        • Multi-Card Selection and Cross-Zobot Copy-Paste Functionality

                                                                                                          Dear Zoho SalesIQ Team, We’d like to suggest a productivity-enhancing feature for the Zobot builder in Zoho SalesIQ: the ability to select multiple cards (modules) at once using a selection area, and then copy-paste them either within the same canvas
                                                                                                        • Zoho Books Custom Widgets Deprecation Error

                                                                                                          I created a simple sample widget with zet and published it using sigma Both in the Sandbox and Production the Widgets are showing this error
                                                                                                        • 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
                                                                                                        • Search Bar Improvement for Zoho Commerce

                                                                                                          Hey everyone, I've been using Zoho Commerce for a bit now, and I think the search bar could really use an upgrade. Right now, it doesn't show products in a dropdown as you type, which would make finding items a lot faster. On Shopify, for example, you
                                                                                                        • Ability to Initiate WhatsApp Template Messages in Zoho SalesIQ Without Preexisting Chat

                                                                                                          Hi Zoho SalesIQ Team, I hope you're doing well. I understand that with the WhatsApp integration in SalesIQ, clients can contact us via WhatsApp, and we can use WhatsApp templates to send messages outside of the 24-hour window by reopening an existing
                                                                                                        • 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.
                                                                                                        • Related Lists filter

                                                                                                          I have Contacts showing in our Accounts module. I customized the Contacts module with an Employment Status field, with the following picklist options: "Primary Contact", "Secondary Contact", "Active Staff(not a main contact)", and "No longer employed".
                                                                                                        • Next Page