ZoHo Desk - Custom Function - Retrieving Latest Comment

ZoHo Desk - Custom Function - Retrieving Latest Comment

Hello All,

I currently have a custom function that searches the most recent thread within a ZoHo ticket for specific keywords.


See below excerpt where latestThread is defined

  1.     latestThread = invokeurl
        [
            url :deskURL + "/api/v1/tickets/" + ticketId + "/latestThread?include=plainText"
            type :GET
            headers:{"featureFlags":"blockQuoteContent"}
            connection:"deskconnection"
        ];

In the API documentation, i do see a section on latestThread




I'm wondering if there is similar code that I could use to retrieve the most recent comment on a thread.


I see documentation to list all comments, maybe there is a way to sort by latest comment and limit to 1?


would something like the below achieve this?

    1.     latestComment = invokeurl
          [
              url :deskURL + "/api/v1/tickets/" + ticketId + "/comments?&limit=1&include=plainText&limit=1"
              type :GET
              headers:{"featureFlags":"blockQuoteContent"}
              connection:"deskconnection"
          ];

Thanks,
Chris

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns 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