ServiceNow : Custom App
Last updated
Last updated
This guide will help you to quickly connect to ServiceNow and create various methods to pull the data. The purpose is to demonstrate how easy it is to integrate an external database to the VoiceWorx platform.
Create ServiceNow account
You should have an ServiceNow account, at least one instance and application registered in the ServiceNow. You can follow this document for complete guidance.
Configure Integration with VoiceWorx
Once the ServiceNow account is ready, the next step is to configure integration with the VoiceWorx portal. Follow this guide to complete the configurations.
To proceed with these steps, you should have all the pre-requisites satisfied. If you are missing something, please go back and make sure you satisfy all of them.
Once done, you are ready to get started using VoiceWorx platform with ServiceNow.
Login to the VoiceWorx portal at https://portal.voiceworx.ai
To Configure SeviceNow, browse to: Integration > Connect System > Connect External System in the VoiceWorx platform and select options as shown below. Make sure that Prerequisite#2 has been fulfilled by your organization administrator before proceeding with this.
On Clicking connect system, the user will be prompted to allow access to the developer instance in SeviceNow.
Enter the login credentials and click “Login”.
After a successful login to ServiceNow, SmartOffice would request to connect with your ServiceNow instance. Click the “Allow” button. Connection of VoiceWorx portal with ServiceNow will be successful after the access has been allowed as shown below:
.
If you face issues in this connection, you might want to go and visit ServiceNow: Connect to VoiceWorx document guide.
Your ServiceNow integration is now available for use in VoiceWorx portal.
To create an app, browse to Custom Apps > Manage Apps and click on Create New Custom App button as shown below.
You should see a small popup as shown below.
Click on save, this will create an app and you should see a screen as shown below,
This shows that an app is successfully created, and you have various options like setup data sources. This is explained in next step.
To follow this step, make sure you have completed above Step 2. If not please go back and do it.
A Data Source connects the app with the ServiceNow integration we did in Step #1. Once you have an app created, you can go o Data Sources by either clicking on “Data Source” button or by clicking on “Data Sources” tab.
Now you should see screen as shown below.
To create a data source, click on ‘Create New Data Source’ button and you should see a popup screen as shown below
Give a name of your choice and make sure you select the ServiceNow integration that you have created in Step 1 and click on Save. Now you should see a Data Source created as shown in below screenshot.
once a data source is created, you are ready to start creating various methods.
To use this step, make sure you have completed previous step. If not go back and complete it.
Methods allows you to fetch data from the ServiceNow table. To access the methods, click on the “Methods” tab which is next to the “Data Sources” tab.
As of the publication date of this document, the VoiceWorx platform supports following DynamoDB methods,
Create Ticket
Create Ticket by Priority
Execute Query
Get All Tickets
Get Open Tickets
Get Tickets by Assignee
Get Tickets by Priority
Get Tickets by Requester
Get Tickets by Status
Get Tickets by Subject
Get Tickets Count by Assignee
Get Tickets Count by Priority
Get Tickets Count by Requester
Get Tickets Count by Status
Depending on requirement, you will have to use an appropriate method, this document will explain each of these methods with an example.
Let’s start with a use case.
You have a ServiceNow to organize ticketing in your organization.
You want to create a ticket for an issue you are facing. For this, you can use CreateTicket method as explained below.
This method requires three parameters as explained below.
Other than these two parameters, you need to provide the following standard inputs
Create new method
Similarly, all methods available for ServiceNow can be customized.
The next step of app building is creating corresponding Intents for the above methods.
Name: CreateTicketIntent
Intent Type: Search
Intent Action: Execute Method
Data Source: ServiceNowDS
Data Source Method: CreateTicket
GetTicketsByAssignee
Name: GetTicketsByAssignee
Intent Type: Search
Intent Action: Execute Method
Data Source: ServiceNowDS
Data Source Method: GetTicketsByAssignee
Now, repeat the same process for other remaining methods.
You have to create slots corresponding to the parameters in the above created method. For example, for method GetTicketsByAssignee, Assignee was the parameter used. Now, create Assignee as the Slot for GetTicketsByAssignee.
Details:
Name: Assignee
Slot Order: 0
Reprompt Message: Whose tickets shall I search?
Type: Full Name
Custom App: ServiceNow Demo
Intent: GetTicketsByAssignee
Utterances are used for invocating the intent. You have to create utterances corresponding to each intent. For example, let’s create utterance for CreateTicketIntent.
Go to Utterances tab, select CreateTicketIntent in the dropdown and click on ‘Create New Utterance’.
You can also create multiple utterance for an intent. You can also opt for the Bulk Edit feature to create multiple utterances at one go.
Again, you have to create utterances for every intent.
Now, create inputs corresponding to the intents created in above steps. One input corresponding to one input has to be created.
Details:
Name: GetTicketsByRequester
Custom Skill: ServiceNow Demo
Custom Intent: GetTicketsByRequesterIntent (any intent you’ve created)
Data Source: ServiceNowDS
Data Source Method: GetTicketsByRequester
The final step is to publish app to your desired channel. Let’s publish the app to Alexa for this demo.
Select Publish tab and click on Add App Publishing.
After the setup is done, Publish the App to Alexa.
Select the LWA account and click on publish.
You shall get the success message and you can go to your Alexa developer account and test the app by clicking on Go to Alexa Skill. Make sure to log in with the same LWA credential to which the app has been published.
Input
Information
Name
You can give any value of your choice.
Custom Skill Type
Select Search
Category
Default.
Parameter
Sample Value
Info
ShortDescription
{{ShortDescription}}
To be entered by the user.
A short description on what the ticket is for.
Priority
Moderate
(To be selected from dropdown depending upon the urgency of the ticket.)
Key Value pair in a valid json format.
RequesterEmail
{{Context.Email}}
This shall draw the email you are logged in with in VoiceWorx.
Email from which the ticket create request originated.
Parameter
Info
Method Name
You can give any name. This name will be displayed in the methods list.
Request Type
CreateTicket
This is the method that you are using
Parameters
As explained in the previous table
Result Type
Record (Auto Selected)
It indicates that the method can return one or more records
Record JsonPath
Each method returns data in json format and to pick any specific information from the json, we need to specify the Record JsonPath so Voice Worx platform will pick that data in consideration while displaying results.
Example: $.[*]
This selects all the records that is returned.
Result Template
This indicates how method results should be represented.
Here its providing confirmation that the ticket has been created.
Great I was able to create the ticket for you. How else can I help you?
Parameter
Info
Method Name
GetOpenTickets
Request Type
GetOpenTickets
This is the method that you are using
Parameters
As explained in the previous table. No parameters for this method
Result Type
ListOfRecords (Auto Selected)
It indicates that the method can return one or more records
Record Limit
Numeric value (e.g. 10)
If Method is returning larger number of records, then you can limit this result by providing this value.
Record JsonPath
Each method returns data in json format and to pick any specific information from the json, we need to specify the Record JsonPath so Voice Worx platform will pick that data in consideration while displaying results.
Example: $.[*]
This selects all the records that is returned.
Record Template
Ticket Number: {{number}} - {{short_description}}
Note:
Anything written in between {{ }} is represented as a json field and it’s case-sensitive.
Result Template
Here are the open tickets I've found. How else can I help you?
Empty Result Template
Sorry, no open tickets found. How else can I help you?
This message is returned if data that matches the method condition is not found.
Parameter
Sample Value
Info
Status
New
Available status values are:
New
InProgress
OnHold
Resolved
Closed
Cancelled
Parameter
Info
Method Name
GetTicketsByNewStatus
Request Type
GetTicketsByStatus
This is the method that you are using
Parameters
Status: New
Result Type
ListOfRecords (Auto Selected)
It indicates that the method can return one or more records
Record Limit
Numeric value (e.g. 10)
If Method is returning larger number of records, then you can limit this result by providing this value.
Record JsonPath
Each method returns data in json format and to pick any specific information from the json, we need to specify the Record JsonPath so Voice Worx platform will pick that data in consideration while displaying results.
Example: $.[*]
This selects all the records that is returned.
Record Template
Ticket Number {{number}} - {{short_description}}
Note:
Anything written in between {{ }} is represented as a json field and it’s case-sensitive.
Result Template
Here are the new tickets I've found. How else can I help you?
Empty Result Template
Sorry, no new tickets found. How else can I help you?
Parameter
Sample Value
Info
Requester
{{Requester}}
Requester of the ticket
Parameter
Info
Method Name
GetTicketsByRequester
Request Type
GetTicketsByRequester
This is the method that you are using
Parameters
Status: New
Result Type
ListOfRecords (Auto Selected)
It indicates that the method can return one or more records
Record Limit
Numeric value (e.g. 10)
If Method is returning larger number of records, then you can limit this result by providing this value.
Record JsonPath
Each method returns data in json format and to pick any specific information from the json, we need to specify the Record JsonPath so Voice Worx platform will pick that data in consideration while displaying results.
Example: $.[*]
This selects all the records that is returned.
Record Template
Ticket Number {{number}} - {{short_description}}
Note:
Anything written in between {{ }} is represented as a json field and it’s case-sensitive.
Result Template
Here are the tickets requested by {{Input.Requester}}. How else can I help you?
Empty Result Template
Sorry, no new tickets found for {{Requester}}. How else can I help you?