Automation #3 - Auto-sync email attachments to tickets

Automation #3 - Auto-sync email attachments to tickets




This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk.









Most of our customers use email as their primary channel for customer support. Keeping that in mind we ensured Zoho Desk's multi-channel capability allowed for every email received in your inbox to be automatically converted into tickets in Zoho Desk. But for some time now, we have been receiving question on how to convert email attachments into ticket attachments within Zoho Desk. This process, which is mostly achieved manually now by many customers, can be automated using a simple script.




This automation involves two components: a connection and a workflow rule. We will first start by creating the connection and then set up the workflow rules to execute the custom function.






To create the connection, perform the following steps:
  1. Go to Setup > Connections under Developer Space
  2. Click "Create Connection"
  3. Select "Zoho Desk" under "Default Services"
  4. Give the connection name as "ticketattachment"
  5. Under Scope below values
    Desk.tickets.READ
    Desk.tickets.UPDATE
  6. Click "Create and Connect"

  7. Click "Connect" and click "Accept"


Connection is created successfully.

To create workflow rule and associate custom function, perform the following steps:
  1. Go to Setup, and under Automation, click Workflows.
  2. On the left panel, under Workflows, click Rules > Create Rule,
    In the Basic Information section, carry out the following steps:
  3. In the Module drop-down menu, select Tickets.
  4. Enter a name and description for the rule.
  5. If you want to activate the rule right away, select the Active checkbox. Else, you can just create the rule now and activate it later, on the Rules page.
  6. Click Next.
    In the Execute on section, perform the following steps:
  7. Select the Create checkbox to execute this rule every time a new ticket is created. 
    NOTE: If you would like to fetch all the attachment sent out and received in tickets, select "Customer Reply" and "Agent Response"
  8. Click Next, skip the "Criteria" and Click Next.
  9. In the Actions section, carry out the following steps:
  10. Click the + icon under "Action" and select "New" next to Custom Functions
  11. Enter a name and description for the custom function.
  12. In the script window, input the Custom Function you find below:

    1. //Replace your zoho desk URL accordingly
    2. getTicketThread = invokeurl
    3. [
    4. url :deskDomain + "/api/v1/tickets/" + ticketID + "/latestThread"
    5. type :GET
    6. connection:"ticketattachment"
    7. ];
    8. dir = getTicketThread.get("direction");
    9. info "Direction " + dir;
    10. if(dir == "in")
    11. {
    12. prefix = "customer_";
    13. }
    14. else
    15. {
    16. prefix = "agent_";
    17. }
    18. listAttachments = getTicketThread.get("attachments");
    19. for each  attach in listAttachments
    20. {
    21. attachmentURL = attach.get("href");
    22. filename = prefix + attach.get("name");
    23. getAttachment = invokeurl
    24. [
    25. url :attachmentURL
    26. type :GET
    27. connection:"ticketattachment"
    28. ];
    29. if(getAttachment != null)
    30. {
    31. if(isText(getAttachment))
    32. {
    33. getAttachment = getAttachment.toFile(filename);
    34. }
    35. //info getAttachment;
    36. param = Map();
    37. param.put(filename,getAttachment);
    38. getAttachment.setParamName("file");
    39. uploadResponse = invokeurl
    40. [
    41. url :deskDomain + "/api/v1/tickets/" + ticketID + "/attachments"
    42. type :POST
    43. parameters:param
    44. headers: {"Content-Type":"multipart/form-data"}
    45. connection:"ticketattachment"
    46. ];
    47. info uploadResponse;
    48. }
    49. }



  13. Click Edit Arguments
  14. In the Name field type TicketID, and from the Value drop-down list select Ticket Id under Ticket Information
  15. Click "Save" to save the custom function

  16. Click "Save" again to save the workflow.
This should help you fetch attachments from incoming or outgoing response of a ticket and update them under tickets attachments tab.

    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.






                              Zoho Developer Community




                                                    • 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


                                                              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

                                                                                                Get Started. Write Away!

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

                                                                                                  Zoho CRM コンテンツ






                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方




                                                                                                                • Recent Topics

                                                                                                                • Zia Emails Summary: Instant context from past emails

                                                                                                                  Hello all, Reading all of the past emails associated with a specific record can be tedious, which in turn makes it difficult to understand the context quickly, as these messages often include irrelevant details that waste time. This is true for everyone
                                                                                                                • Boost your CRM communication with new font types, sizes, and default reply-to options while composing emails

                                                                                                                  Hello Everyone, We’re excited to introduce a series of impactful enhancements to the email composer settings in Zoho CRM. These updates enable you to personalize and optimize your customer interactions with greater efficiency. So what's new? Add custom
                                                                                                                • Custom Portal URL causing SAMEORIGIN error with embedded Page snippet

                                                                                                                  In my app, I have a page that embeds another page. The URL that I have for the embedded page starts with https://creatorapp.zoho.com but the custom domain I have set up is https://kors.kerndell.com. Because the user logged into the app at https://kors.kerndell.com,
                                                                                                                • Automating CRM backup storage?

                                                                                                                  Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                                                                                                • Bing ads integration and tracking

                                                                                                                  Hi, Is there any way to track Bing ads in the same way that we are able to track google adwords?  It is important for us to be able to determine the conversion rate of our Bing ads.  If this is not possible now, will this feature be added in the future?
                                                                                                                • Zoho Creator Calendar - Sorting Events

                                                                                                                  Hi, I have a calendar view to hold the schedule for a group of engineers. I have created a formula field to show the combination of fields I want visible as the title of the event, but I need to be able to sort the list by something other than the event
                                                                                                                • Create a "My saved custom themes" section in Zoho Forms

                                                                                                                  Hi! I created lots of forms for my company that we embed on the website with a custon design. It is a pain not to be able to save a custom layout as a template and just not to have to do it again! So could you add a gallery like : "My saved themes" ?
                                                                                                                • Upcoming Update: Disposition Sync for Indeed

                                                                                                                  We’re updating our Indeed integration to support Disposition Sync, improving how candidate application statuses are communicated. This change is scheduled to go live on 15 June, 2026. What’s changing? Once enabled, this allows candidate application statuses
                                                                                                                • Joining Two Tables on Multiple Ids

                                                                                                                  Hello all, I'm guessing there is an obvious solution for this, but definitely not an expert in sql. On our Deals module, we have two user lookup fields. In Analytics, those fields have the user's ids in those table rows, and I'm trying to create a query
                                                                                                                • auto update of item purchase cost

                                                                                                                  Would be nice if, when entering bills, the price of the item varied from the stored item price, we could have a user dialogue "Update item price" | "yes / no". Simple, but saves a lot of additional work !
                                                                                                                • Journeys - How to set up a webhook that triggers when a contact meets the goal criteria?

                                                                                                                  Hi there, I'm setting up a journey on Marketing Automation. The main goal of the journey is to get the leads to reply our emails. Is there a way to trigger a webhook when that goal is met? The webhook would then trigger a notification. Is that possible?
                                                                                                                • Latest updates in Zoho Meeting | Personal Meeting Rooms and Zoho Meeting Annotator

                                                                                                                  Hello everyone, We’re excited to share a few updates for Zoho Meeting. Here's what we've been working on lately: Introducing Personal Meeting Rooms - Tailored for private discussions, this secure meeting space is yours alone, accessible via a unique link.
                                                                                                                • Canvases Auto-Skewing/Adding Scroll Bars When They Were Not There Prior

                                                                                                                  Is anyone else noticing rendering issues in their canvases today? It seems to be mainly icons which now have scroll bars added which makes them all look off, though some fields seemed to revert to squished length as well. Were the icons replaced with
                                                                                                                • New UI for Writer - Disappointed

                                                                                                                  I've been enjoying Zoho Writer as a new user for about 6 months, and I really like it. One of my favorite things about it is the menu bar, which you can hide or leave out while still seeing most of your page because it is off to the left. I think this
                                                                                                                • The reason I switched away from Zoho Notebook

                                                                                                                  My main reason for switching to Zoho was driven by three core principles: moving away from US-based products, keeping my data within India as much as possible, and supporting Indian companies. With that intent, I’ve been actively de-Googling my digital
                                                                                                                • Introducing the enhanced Zoho People integration

                                                                                                                  We're excited to announce an enhancement to the integration between Zoho Recruit and Zoho People, designed to streamline your data management processes and boost efficiency across your recruitment and HR workflows. With this latest update, you can now
                                                                                                                • Zia should track how customer relationships evolve over time

                                                                                                                  Here's a feature idea that I've been thinking about The Problem Zia is great at analyzing individual interactions email sentiment, call transcription, best time to contact. But here's what it can't do: tell you how a relationship has evolved over time.
                                                                                                                • Add an option to disable ZIA suggestions

                                                                                                                  Currently, ZIA in Zoho Inventory automatically provides suggestions, such as sending order confirmation emails. However, there is no way to disable this feature. In our case, orders are automatically created by customers, and we’ve built a custom workflow
                                                                                                                • Filter our rejected quote items from the inventory quote template

                                                                                                                  Hello, I am trying to have rejections at the line level on my quotes so I can track what items are often removed, I do not want to claim the whole quote as lost just the individual items for better data tracking. However I cannot figure out how to filter
                                                                                                                • Error AS101 when adding new email alias

                                                                                                                  Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                                • Gamescope is leveling upto Motivator for Zoho CRM

                                                                                                                  Hello,   As you are aware, we recently made Motivator for Zoho CRM available for Zoho One, CRMPlus and CRM Ultimate editions. Since Motivator has all the features of Gamescope and even more advanced gamification, we are planning to EOL Gamescope on 30th
                                                                                                                • Print JV of an Expenses in ZohoBooks

                                                                                                                  When an expense is created in Zoho Books, the related journal entry can be viewed at the bottom of the expense record. However, when printing the expense, the journal entry is not included in the printed document, and there does not appear to be an option
                                                                                                                • Kiosk waiting for completion breaks previous field updates from occurring, yet timeline of record show changes

                                                                                                                  hi 1) I set to statuses on a Get record . 2) Next i run a function and capture the result i.e. wait for completion 3) Then a Screen The record's timeline show the status changes. Yet the record has not changed. I can repeat this. I had another route in
                                                                                                                • Write-Off multiple invoices and tax calculation

                                                                                                                  Good evening, I have many invoices which are long overdue and I do not expect them to be paid. I believe I should write them off. I did some tests and I have some questions:  - I cannot find a way to write off several invoices together. How can I do that,
                                                                                                                • Partner with HDFC And Sbi Bank.

                                                                                                                  Hdfc and sbi both are very popular bank if zoho books become partner with this banks then many of the zoho books users will benefit premium features of partnered banks.
                                                                                                                • Print shipping label on Zebra Label printer from ZOHO Creator deluge

                                                                                                                  Hi All, Allow me to guide you through the process of printing a shipping label from ZOHO Creator to a Zebra label printer (ZD421D). Step 1: To start, configure the SendFileToPrinter API, which enables the transmission of a file to a Zebra Link-OS printer.
                                                                                                                • Zoho Books Placeholder: Inventory Counts

                                                                                                                  I was hoping to figure out how to find the placeholders for inventory counts by item. We use Location based inventory tracking, so I dont know if that affects things. I want my PDF and Printed PICK LISTS to show the Quantity Available to Pick. I have
                                                                                                                • Can't delete shared mailbox emails from mobile app

                                                                                                                  I have the mobile app on iOS and cannot seem to find a way to delete an email from a shared mailbox. Is there something I'm missing here? Michael
                                                                                                                • Simple Custom Function to Update Candidate status

                                                                                                                  Hi folks, We are currently using Zoho Recruit and have sources from where candidates are applying. Currently all candidates are being set to 'Associated' when they apply via 3rd party sources but that is not useful for us under our business process. I
                                                                                                                • Zoho FSM Work Order Creation Failure

                                                                                                                  Hello FSM team and Latha, This automation is built in Zoho Creator and is triggered when a “New Repair Order” is created or updated through form submission. Once the form is submitted, the script automatically retrieves the related customer and company
                                                                                                                • A method for renaming tab titles in Creator to display more relevant information

                                                                                                                  Hi Zoho Devs, Updates: Rules Export File attached; you can now import this into Tab Modifier instead of manually entering the rules yourself) 2022-06-08: Updated rules so that crm.zoho.com tabs are not affected; uploaded new .json import file 2022-06-09:
                                                                                                                • Options on the New Auto Logged In User Profile for the Name Field

                                                                                                                  Hi, I love the new function, but when used it automatically formats the record and therefore the export with comma separated values, so id you enable First Name & Last Name it puts "First Name, Last Name" rather than just "First Name Last Name". Could
                                                                                                                • Zoho Practice Roadmap

                                                                                                                  Hi - interested to understand the roadmap for this product. I think a number of people are watching to see if this is receiving investment prior to exploring more - but it appears to be very quiet on the development front.
                                                                                                                • CRITICAL DOWNTIME IN ZOHO PRACTICE!! NO RESPONSE FROM SUPPORT TEAMS

                                                                                                                  Dear Team, We are randomly unable to login to Zoho Practice since this morning. All our team members are reporting this issue. Work has come to a grinding halt and we are not getting any support or answers. This is a highly serious matter of concern for
                                                                                                                • Tip 49#: Obtaining global reports in Zoho Sprints

                                                                                                                  Zoho Sprints comes with data analysis capabilities like reports and dashboards that enable the project teams to introspect quantifiable information. These reports and dashboards are project specific. Recently, a user contacted us regarding a requirement
                                                                                                                • Clone entire dashboards

                                                                                                                  If users want to customize a dashboard that is used by other team members, they can't clone it in order to customize the copy. Instead they have to create the same dashboard again manually from scratch. Suggestion: Let users copy the entire dashboard
                                                                                                                • Zoho Cliq REST APIs v3 : A complete guide to what's changed and why 

                                                                                                                  APIs are not just consumed by a developer with numerous automations and a series of open browser tabs. They are parsed by LLMs, fed into agent pipelines, and auto-completed by AI coding assistants that have zero tolerance for inconsistency. A verb tucked
                                                                                                                • Allow native Webhooks to authenticate via Connections

                                                                                                                  Allow native Webhooks to authenticate via Connections (Basic Auth) instead of plaintext custom headers Summary Please allow native Webhooks (Workflow Rules > Instant Actions > Webhooks) to authenticate against the destination endpoint using the existing
                                                                                                                • Zoho desk extension update custom field

                                                                                                                  Hi all, I'm trying to update a custom field in my zohodesk extension. But the documentation is fairly unclear. The custom field is named "testveld". The api name is cf_testveld I'm trying to update it like this: ZOHODESK.set('ticketForm.cf_testveld',
                                                                                                                • Introducing Custom Columns in Forecasts in Zoho CRM

                                                                                                                  Release Plan: Enabling in Phased Manner, Enabled for JP DC Hello all, Forecasts in Zoho CRM help sales representatives, managers, and business stakeholders evaluate performance and plan future sales activities. While standard metrics such as Target, Achieved
                                                                                                                • Next Page