Extension Pointers for Integrating Zoho CRM with Zoho products #3: Keep track of your Zoho Desk tickets from within Zoho CRM

Extension Pointers for Integrating Zoho CRM with Zoho products #3: Keep track of your Zoho Desk tickets from within Zoho CRM

Operating a business necessitates complete management of all individual units in order to achieve smooth operations. Working with a CRM solution and handling support-related tickets are two critical units that must work together for a successful outcome.

In this post, we'll look at how you can use an extension to integrate Zoho Desk with Zoho CRM and track desk tickets from within your CRM. Consider a scenario where the contacts present in Zoho CRM have tickets in Zoho Desk associated with different products offered. Now, if those tickets appear as a related list in every contact, it's easier for sales representatives to keep track from within the CRM itself.

Creating a connector for Zoho Desk and adding connector APIs
  • Create a new connector in your extension for Zoho Desk using the Connectors feature under Utilities in the left panel of the Zoho Developer console.
  • Note: Zoho Desk follows OAuth2.0 protocols for authentication. You can refer to this post to understand the steps to register Zoho Desk and retrieve your client credentials.
                     
The connector details for our example are:


The Zoho Desk REST APIs added for our example are mentioned below.

Connector API Name
Method type
URL
Get tickets by contact
GET
https://desk.zoho.com/api/v1/contacts/${contactid}/tickets
Search Contacts
GET
https://desk.zoho.com/api/v1/contacts/search?limit=1&email=${email}


Note: You can refer to this post to understand the detailed steps involved in creating a connector, adding the connector APIs, and associating it with the extension.

Creating a related list and associating a custom related list function to it
  • Create a related list called "Desk Tickets" using the Related Details feature available in the Components section of the Zoho Developer console, then associate a custom function to perform the desired action. 
  • Note: In order to store the organization ID of the desk portal from which the tickets are to be fetched, a CRM variable is created named 'Orgid'. The value for the variable will be entered by the user during extension installation.


Desk tickets function code snippet

//Retrieving the record details and storing the email value
response = zoho.crm.getRecordById("Contacts",contact.get("Contacts.ID").toLong());
Email = response.get("Email");
orgid = zoho.crm.getOrgVariable("xxx__Orgid");
dynamic_map = Map();
dynamic_map.put("email",Email);
dynamic_map.put("orgid",orgid);
/*Invoking the search desk contacts api by passing the email id value retrieved from the get records*/
resp = zoho.crm.invokeConnector("xxx.desk.searchcontacts",dynamic_map);
responsedata = resp.get("response");
data = responsedata.get("data");
//Fetching the id of the desk contact
for each value in data
{
id = value.get("id");
}
dynamic_map = Map();
orgid = zoho.crm.getOrgVariable("xxx__Orgid");
dynamic_map.put("contactid",id);
dynamic_map.put("orgid",orgid);
//Invoking the get tickets by contacts api by passing the contact id value retrieved 
resp1 = zoho.crm.invokeConnector("xxx.desk.getticketsbycontact",dynamic_map);
responsedata1 = resp1.get("response");
data1 = responsedata1.get("data");
resp = "";
count = 1;
//constructing the record for related list
recordsXmlStr = "<record>";
for each value in data1
{
recordsXmlStr = recordsXmlStr + "<row no='" + count + "'>";
weburl = value.get("webUrl");
ticketNumber = value.get("ticketNumber");
recordsXmlStr = recordsXmlStr + "<FL val='Associated ticket list' link=\"true\" url='" + weburl + "'>" + value.get("subject") + "- #" + ticketNumber + "</FL>";
recordsXmlStr = recordsXmlStr + "<FL val='Status'>" + value.get("status") + "</FL>";
recordsXmlStr = recordsXmlStr + "</row>";
count = count + 1;
}
recordsXmlStr = recordsXmlStr + "</record>";
resp = resp + recordsXmlStr;
return resp;
  • The above code snippet retrieves the current CRM contact record details, from which the email address value is fetched and stored
  • This email address is then passed along with the value of the CRM variable 'Orgid' to the search desk contacts API, which retrieves the contact ID of the customer associated with that email address
  • The retrieved contact ID is passed to the get tickets by contact API, which returns a list of all available tickets for that customer
  • Now that we have seen the functionality and code, let's see a sample output of how this works. 
  • Enter the org ID value during installation.

  • Go to a Zoho CRM contact's detail page. Choose the related list 'Desk Tickets.'

  • The ticket details, such as subject and status, are populated

  • The ticket subject is also hyperlinked, redirecting to the ticket details page, so that the sales representative can easily keep track of available tickets and their status


This way you can integrate Zoho CRM with Zoho Desk and the functionality can be enhanced based on your business requirements. We hope you find this information useful. Keep following this space for more tips and recommendations.


SEE ALSO



    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