Auto-Sync Zoho Desk Ticket Attachments to Zoho CRM Contacts

Auto-Sync Zoho Desk Ticket Attachments to Zoho CRM Contacts

Overview:


When Zoho CRM is integrated with Zoho Desk, contacts from CRM are automatically synced into Desk. These contacts can raise tickets in Zoho Desk, which often include important attachments like images, documents, or logs. In many cases, businesses want to ensure these attachments are also available in the CRM for easy access and future reference.

This article explains how to automate the process of fetching attachments from the latest thread of a Zoho Desk ticket and uploading them to the corresponding contact's record in Zoho CRM using a custom function and a workflow rule.


Business case:

In customer-facing organisations using Zoho CRM and Zoho Desk, it’s common for support tickets submitted via Desk to include important attachments such as invoices, screenshots, legal documents, contracts, and more. However, these attachments remain separated within Desk and are not automatically synced to the associated Contact or Account in Zoho CRM.

For teams that rely on CRM as the single source of truth for customer profiles and documents, this leads to:
  • Redundant file management
  • Incomplete CRM records
By automating the syncing of ticket attachments from the latest customer reply in Desk to the Attachments related list of the corresponding CRM contact, you:
  • Ensure CRM always has the latest files
  • Improve visibility for sales/account teams
  • Avoid manual downloading and reuploading
  • Streamline customer data consolidation
This automation especially benefits teams managing high ticket volumes, where manual syncing is not scalable.



Step 1: Configure the Workflow Rule in Zoho Desk

  1. Navigate to Zoho Desk > Settings > Automation > Workflows.
  2. Click Create Workflow Rule.
  3. Name the rule and choose Trigger: Customer Reply.
  4. Define conditions as required.
  5. Under Action, choose Custom Function.
  6. Map the argument ticketid with the ticket ID.
  7. Paste the custom function code provided below.


Code:


  1. ticketInfo = invokeurl
  2. [
  3. url :"https://desk.zoho.com/api/v1/tickets/" + ticketid + ""
  4. type :GET
  5. connection:"desk"
  6. ];

  7. contactId = ticketInfo.getJSON("contactId");
  8. contactInfo = invokeurl
  9. [
  10. url :"https://desk.zoho.com/api/v1/contacts/" + contactId + ""
  11. type :GET
  12. connection:"desk"
  13. ];
  14. info contactInfo;

  15. crmContactID = contactInfo.getJSON("zohoCRMContact").get("id");

  16. latestThreadInfo = invokeurl
  17. [
  18. url :"https://desk.zoho.com/api/v1/tickets/" + ticketid + "/latestThread"
  19. type :GET
  20. connection:"desk"
  21. ];

  22. attachmentsInfo = latestThreadInfo.get("attachments");

  23. for each  attachment in attachmentsInfo
  24. {
  25. attachmentURL = attachment.get("href");
  26. fileName = attachment.get("name");

  27. getAttachment = invokeurl
  28. [
  29. url :attachmentURL
  30. type :GET
  31. connection:"testa"
  32. ];

  33. if(getAttachment != null)
  34. {
  35. if(isText(getAttachment))
  36. {
  37. getAttachment = getAttachment.toFile(filename);
  38. }
  39. param = Map();
  40. param.put(fileName,getAttachment);
  41. getAttachment.setParamName("file");
  42. info "getAttachment:" + getAttachment;
  43.         uploadAttachment = zoho.crm.attachFile("Contacts",crmContactID,getAttachment,"crm");
  44. info uploadAttachment;
  45. }
  46. }

Screenshots for reference:






API References:
Notes
Note: This method works only if your contacts in Desk are synced via Zoho CRM. The zohoCRMContact ID is essential for locating the corresponding record in CRM.



Note: This related Zoho CRM contact ID will be available in the case of contact synced via Zoho CRM - Zoho Desk Integration.

Output:

Every time a customer responds to a ticket in Zoho Desk with an attachment, the file will automatically be uploaded to the related contact in Zoho CRM.

Screenshot of attachments in Zoho Desk:



Screenshots of attachments in related contacts in Zoho CRM:



Conclusion:


By configuring this automation, you can streamline the way your organisation manages customer-related files. It eliminates the need for manual file uploads between Zoho Desk and Zoho CRM and ensures all customer-related documents are accessible directly from CRM. 



Custom Solution Created by Santhiya| Zoho Partner Support

If you need any further clarifications, please don’t hesitate to contact -  partner-support@zohocorp.com.

Additionally, we kindly ask all "Europe and UK partners" to reach out to partner-support@eu.zohocorp.com.



        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG


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

                                              Create. Review. Publish.

                                              Write, edit, collaborate on, and publish documents to different content management platforms.

                                              Get Started Now




                                                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                    Manage your brands on social media


                                                                      • Desk Community Learning Series


                                                                      • Digest


                                                                      • Functions


                                                                      • Meetups


                                                                      • Kbase


                                                                      • Resources


                                                                      • Glossary


                                                                      • Desk Marketplace


                                                                      • MVP Corner


                                                                      • Word of the Day


                                                                      • Ask the Experts


                                                                        Zoho Sheet Resources

                                                                         

                                                                            Zoho Forms Resources


                                                                              Secure your business
                                                                              communication with Zoho Mail


                                                                              Mail on the move with
                                                                              Zoho Mail mobile application

                                                                                Stay on top of your schedule
                                                                                at all times


                                                                                Carry your calendar with you
                                                                                Anytime, anywhere




                                                                                      Zoho Sign Resources

                                                                                        Sign, Paperless!

                                                                                        Sign and send business documents on the go!

                                                                                        Get Started Now




                                                                                                Zoho TeamInbox Resources





                                                                                                          Zoho DataPrep Demo

                                                                                                          Get a personalized demo or POC

                                                                                                          REGISTER NOW


                                                                                                            Design. Discuss. Deliver.

                                                                                                            Create visually engaging stories with Zoho Show.

                                                                                                            Get Started Now








                                                                                                                                  Wherever you are is as good as
                                                                                                                                  your workplace

                                                                                                                                    Resources

                                                                                                                                    Videos

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



                                                                                                                                    eBooks

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



                                                                                                                                    Webinars

                                                                                                                                    Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                    CRM Tips

                                                                                                                                    Make the most of Zoho CRM with these useful tips.



                                                                                                                                      Zoho Show Resources