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.
-
//Change your Zoho Desk organization ID
-
orgId =
12345
;
-
ticketnumber = "";
-
if(session.containsKey("ticketnumber"))
-
{
-
ticketnumber = session.get("ticketnumber").get("value");
-
}
-
searchQuery = Map();
-
searchQuery.put("ticketNumber",ticketnumber);
-
//zohodesk3 - Connection name
-
ticketstatus = zoho.desk.searchRecords(orgId,"tickets",searchQuery,0,1,"
zohodesk3
");
-
status = "Invalid ticket number";
-
if(!ticketstatus.isEmpty() && ticketstatus.containKey("data"))
-
{
-
status = ticketstatus.get("data").toMap().get("status");
-
}
-
response = Map();
-
response.put("status",status);
-
return response;
-
Then, click
Save
, preview the plug and
Publish
it.
-
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,
ticket.id
is the bot context that stores ticket number obtained from the visitors and
status.check
is the status to be shown to the visitor.
Note:
-
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:
Zoho SalesIQ Resources
Zoho Pagesense Resources
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Desk Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.