Plug Sample #1 : Fetch ticket status from Zoho Desk on Codeless bot!

Plug Sample #1 : Fetch ticket status from Zoho Desk on Codeless bot!

Hi everyone, Good to see you. 

Are you using the Codeless bot platform for building your bot? Did you know that plugs are exclusively made for performing customized actions on Codeless bot? 
Here is a simple plug for fetching the status of the ticket from Zoho Desk. This plug can get the ticket ID from the visitor and update them with the status of their ticket. You can do slight customization to the script and use it. Let's know how to create and use this plug in real time. 

How to Create this Plugs?
  • In your SalesIQ Dashboard, navigate to Settings>Developers>Plugs> Click on Add .
  • Provide your Plug a name, description, select the Platform as SalesIQ Scripts , and click on Create Plug
  • Click on Parameters, provide the following,
             1. Input Parameters : Ticket Number | Data Type  : Number
             2. Output Parameters : Status of the ticket | Data Type : String

  • Copy, paste the below code and change your Zoho Desk Organisation ID and Connection name. 
  1. //Change your Zoho Desk organization ID
  2. orgId =  12345 ;
  3. ticketnumber = "";
  4. if(session.containsKey("ticketnumber"))
  5. {
  6. ticketnumber = session.get("ticketnumber").get("value");
  7. }
  8. searchQuery = Map();
  9. searchQuery.put("ticketNumber",ticketnumber);
  10. //zohodesk3 - Connection name
  11. ticketstatus = zoho.desk.searchRecords(orgId,"tickets",searchQuery,0,1," zohodesk3 ");
  12. status = "Invalid ticket number";
  13. if(!ticketstatus.isEmpty() && ticketstatus.containKey("data"))
  14. {
  15. status = ticketstatus.get("data").toMap().get("status");
  16. }
  17. response = Map();
  18. response.put("status",status);
  19. return response;
  • Then, click Save , preview the plug and Publish it.
How to incorporate Plugs in Codeless bot?
  • Navigate to Settings>Bot>Add and give the necessary informations and select Codeless Bot as bot platform or open an existing bot.
  • Select the Plugs block under Action Block and select the required Plug (The plugs published will be listed here)
  • Provide the Plug inputs (values to be obtained from the visitors) and outputs (value to be given for the visitors). 
  • In this case, is the bot context that stores ticket number obtained from the visitors and status.check is the status to be shown to the visitor. 

  • Create a visitors fields to get ticket ID from the visitor and save the values in context variable for plugs input. 
  • Similarly create a context variable to store the status of the ticket and use this to display the status to the visitors. 
Related Links:

To know more about the features of zobot, kindly visit our Resources Section

                            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 WorkDrive Resources

                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series

                                                                      • Tips


                                                                      • Functions


                                                                      • Meetups


                                                                      • Kbase


                                                                      • Resources


                                                                      • Digest


                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner

                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now