VoiceWorx.ai
Search…
⌃K

ServiceNow : Custom App

Objective

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.

Pre-requisites

  1. 1.
    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.
  1. 1.
    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.

Steps

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.

Step 1 Connect to 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”.
  1. 1.
    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.
  1. 1.
    Your ServiceNow integration is now available for use in VoiceWorx portal.

Step 2 Create an App for ServiceNow

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.
Input
Information
Name
You can give any value of your choice.
Custom Skill Type
Select Search
Category
Default.
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.

Step 3 Create a Data Source

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.

Step 4 Create Methods to fetch the data from ServiceNow

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,
  1. 1.
    Create Ticket
  2. 2.
    Create Ticket by Priority
  3. 3.
    Execute Query
  4. 4.
    Get All Tickets
  5. 5.
    Get Open Tickets
  6. 6.
    Get Tickets by Assignee
  7. 7.
    Get Tickets by Priority
  8. 8.
    Get Tickets by Requester
  9. 9.
    Get Tickets by Status
  10. 10.
    Get Tickets by Subject
  11. 11.
    Get Tickets Count by Assignee
  12. 12.
    Get Tickets Count by Priority
  13. 13.
    Get Tickets Count by Requester
  14. 14.
    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.

Scenario/ Use Case (ServiceNow Assistant):

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.

Method: CreateTicket

This method requires three parameters as explained below.

Parameters:

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.
Other than these two parameters, you need to provide the following standard inputs
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?

Method: GetOpenTickets

Create new method
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.

Parameters: Not required

Sample Response:

Method: GetTicketsByStatus

Parameters:

Parameter
Sample Value
Info
Status
New
Available status values are:
  1. 1.
    New
  2. 2.
    InProgress
  3. 3.
    OnHold
  4. 4.
    Resolved
  5. 5.
    Closed
  6. 6.
    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?

Method: GetTicketsByRequester

Parameters:

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?

Sample Response:

Similarly, all methods available for ServiceNow can be customized.

Create Intents:

The next step of app building is creating corresponding Intents for the above methods.

CreateTicketIntent

Name: CreateTicketIntent
Intent Type: Search
Intent Action: Execute Method
Data Source: ServiceNowDS
Data Source Method: CreateTicket
  1. 1.
    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.

Create Slots

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

Create Utterances:

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.

Create Inputs

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

Publish App

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.

Few Snaps of ServiceNow Assistant Test on Alexa Developer Console.