Servicenow

Overview

ServiceNow is a software as a service (SaaS) platform that automates businesses and streamlines their processes. It supports a variety of modules and solutions, and Leena AI integrates with its IT Service Management suite.

The ServiceNow connector enables your Leena AI Agents to integrate with your organization's ServiceNow platform, facilitating automated ticket management, service catalog operations, and IT service workflows.

API Details

Leena AI integrates with ServiceNow via REST APIs.

Documentation link:

Setup

The ServiceNow connector uses Basic Authentication.

Prerequisites

Before setting up the ServiceNow connector, ensure you have:

  • Administrator access to your ServiceNow instance
  • Valid ServiceNow username and password
  • Access to your ServiceNow instance URL
  • Access to your Leena AI workspace with connector management permissions

Get credentials

Here is how to get credentials from ServiceNow:

  1. Log in to ServiceNow as an admin user in your developer instance
  2. Navigate to your profile:
    1. Click on "My Profile"
    2. Click on "Manage Instance Password"
  3. Note down the following credentials (displayed on this page):
    1. Instance Name
    2. Username
    3. Password
    4. Instance URL

Add connection

Here is how to add a connection on Leena AI:

  1. Log in to your Leena AI workspace
  2. Navigate to Settings > Integrations
  3. Search for "ServiceNow" and select it from the list to add its new connector
  4. Start configuring the connector
    1. Connection ID: Unique identifier for this connection
    2. Connection Name: Descriptive name for your connection
    3. Auth Type: Select "Basic Auth"
    4. Username: Your ServiceNow username
    5. Password: Your ServiceNow password
    6. Instance URL: Your ServiceNow instance URL
  5. Save the connection

Use Cases

Some of the use cases that you can achieve using ServiceNow connector are below:

  • Raise ticket in Leena AI: Raise a ticket through Leena AI's virtual assistant so that the ticket is raised to the relevant assignee and details are reflected in ServiceNow portal
  • Raise ticket in ServiceNow: Raised tickets on ServiceNow portal to be reflected on Leena AI's virtual assistant/case management
  • Ticket detail: Know ticket history (due date, closure details, assignee details, etc.) in Leena AI's virtual assistant
  • Notification of ticket Status: Notified on Leena AI's virtual assistant based on the ticket status (acknowledged, closed, etc.)
  • Comment on ticket: Comment on existing ticket through Leena AI's virtual assistant so that agent can receive comments and same can be reflected in ServiceNow portal

Actions

The following actions are supported for the ServiceNow connector:

Action NameDescription
Get tableList all the available tables.
Create Table RecordCreate entries/record in table.
Get recordsGet the records in table entries.
Update Table RecordUpdate the record in table entries.
Get Table RecordGet detailed record.
Add AttachmentAdd attachment in table.
Get catalogsRetrieves a list of catalogs to which the user has access.
Get catalog detailRetrieves the available information for a specified catalog.
Get catalog categoriesRetrieves the list of available categories for the specified catalog.
Get category detailRetrieves the available information for a specified category.
Get itemRetrieves a list of catalog items
Get item detailRetrieves a specified catalog item detail.
Submit orderSubmit Order for the specified catalog item.
Submit producerCreates a record and returns the Table API relative path and redirect URL to access the created record.

Create Table Record

Creates a new record in the specified ServiceNow table. The Agent can leverage the skill (workflow), which has been designed to insert one record into a table. This action does not support multiple record insertion (batch/bulk). Here are some common use cases:

  • Add a ticket detail in ServiceNow table: Raise a ticket through Leena AI's virtual assistant so that the ticket is raised to the relevant assignee and details are reflected in ServiceNow portal

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Table NameName of the table in which to save the record

Optional

NameDescription
Sys Parm Display NameDetermines the type of data returned, either the actual values from the database or the display values of the fields. Display values are manipulated based on the actual value in the database and user or system settings and preferences. If returning display values, the value that is returned is dependent on the field type: Choice fields (database value may be a number, but display value will be more descriptive), Date fields (database value is in UTC format, display value is based on user's time zone), Encrypted text (database value is encrypted, displayed value is unencrypted based on user's encryption context), Reference fields (database value is sys_id, display value is a display field of the referenced record). Options: true (returns display values), false (returns actual values), all (returns both)
Sys Parm Exclude Reference LinkFlag that indicates whether to exclude Table API links for reference fields. Options: true (exclude links), false (include links)
Sys Parm FieldsComma-separated list of fields to return in the response
Sys Parm Input Display ValueFlag that indicates whether to set field values using the display value or the actual value. Options: true (treats input as display values and manipulates them to be stored properly in database), false (treats input as actual values and stores them without manipulation)
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both

Here is a sample JSON input:

{
  "Table Name": "Incident",
  "Sys Parm Display Name": "true",
  "Sys Parm Exclude Reference Link": "false",
  "Sys Parm View": "desktop"
}

Response

Upon successful creation, the action returns the created record details from the specified table.

Get Table Record

Retrieves a detailed record from a specified ServiceNow table. This action retrieves the record identified by the specified sys_id from the table. Here are some common use cases:

  • Ticket detail: Know ticket history (due date, closure details, assignee details, etc.) in Leena AI's virtual assistant

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
tableNameName of the table from which to retrieve the record
sys_idSys_id of the record to retrieve (String)

Optional

NameDescription
Sys Parm Display NameDetermines the type of data returned, either the actual values from the database or the display values of the fields. Display values are manipulated based on the actual value in the database and user or system settings and preferences. If returning display values, the value that is returned is dependent on the field type: Choice fields (database value may be a number, but display value will be more descriptive), Date fields (database value is in UTC format, display value is based on user's time zone), Encrypted text (database value is encrypted, displayed value is unencrypted based on user's encryption context), Reference fields (database value is sys_id, display value is a display field of the referenced record). Options: true (returns display values), false (returns actual values), all (returns both)
Sys Parm Exclude Reference LinkFlag that indicates whether to exclude Table API links for reference fields. Options: true (exclude links), false (include links)
Sys Parm FieldsComma-separated list of fields to return in the response
Sys Parm Input Display ValueFlag that indicates whether to set field values using the display value or the actual value. Options: true (treats input as display values and manipulates them to be stored properly in database), false (treats input as actual values and stores them without manipulation)
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both
Sys Query No DomainFlag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. Options: false (exclude if not in user's domain), true (include even if not in user's domain)

Here is a sample JSON input:

{
  "tableName": "Incident",
  "sys_id": "1c741bd700478d83673af3",
  "Sys Parm Display Name": "true",
  "Sys Parm View": "desktop"
}

Response

The action returns detailed information about the specified record.

Update Table Record

Updates an existing record in a ServiceNow table. The Agent can leverage the skill (workflow), which has been designed to update the specified record with the name-value pairs included in the request. Here are some common use cases:

  • Comment on ticket: Update comment on existing ticket through Leena AI's virtual assistant so that agent can receive comments and same can be reflected in ServiceNow portal

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
tableNameName of the table in which the specified record is located
sys_idSys_id of the record to update (String)

Optional

NameDescription
Sys Parm Display ValueDetermines the type of data returned, either the actual values from the database or the display values of the fields. Display values are manipulated based on the actual value in the database and user or system settings and preferences. If returning display values, the value that is returned is dependent on the field type: Choice fields (database value may be a number, but display value will be more descriptive), Date fields (database value is in UTC format, display value is based on user's time zone), Encrypted text (database value is encrypted, displayed value is unencrypted based on user's encryption context), Reference fields (database value is sys_id, display value is a display field of the referenced record). Options: true (returns display values), false (returns actual values), all (returns both)
Sys Parm FieldsComma-separated list of fields to return in the response
Sys Parm Input Display ValueFlag that indicates whether to set field values using the display value or the actual value. Options: true (treats input as display values and manipulates them to be stored properly in database), false (treats input as actual values and stores them without manipulation)
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both
Table FieldsAll other fields associated with the table for which the values are to be updated

Here is a sample JSON input:

{
  "tableName": "Incident",
  "sys_id": "1c741bd700478d83673af3",
  "Sys Parm Display Value": "true",
  "Sys Parm View": "desktop"
}

Response

Upon successful update, the action returns the updated record details.

Get Catalog Detail

Retrieves detailed information for a specified service catalog. Here are some common use cases:

  • Service Catalog details: Know about the available service catalog items or list of all the catalog items available. A user can request the Leena AI bot to list/know about the available service catalog items along with description

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog (String)

Optional

NameDescription
Sys Parm viewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both

Here is a sample JSON input:

{
  "Catalog sys_id": "e0330108b837659bba8fb4",
  "Sys Parm view": "desktop"
}

Response

The action returns detailed information about the specified catalog including description and available items.

Get Catalog Categories

Retrieves the list of available categories for a specified service catalog. Here are some common use cases:

  • A user can request Leena AI virtual assistant to list down all the available categories for a Catalog

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog whose categories are requested (String)

Optional

NameDescription
Sys Parm LimitMaximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval
Sys Parm OffsetStarting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks
Sys Parm viewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both

Here is a sample JSON input:

{
  "Catalog sys_id": "e0d00659bba8fb4",
  "Sys Parm Limit": 10000,
  "Sys Parm Offset": 1000,
  "Sys Parm view": "desktop"
}

Response

The action returns a list of categories available in the specified catalog.

Get Item

Retrieves a list of catalog items based on specified criteria. Here are some common use cases:

  • A user can view the items against specific categories of a service catalog. For example: Request for New email, Request for Email Alias, etc. These items can be associated with category: Cloud Services (Email)

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog (String)
Category sys_idSys_id of the category whose items are requested (String)

Optional

NameDescription
Sys Parm LimitMaximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval
Sys Parm OffsetStarting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks
Sys Parm viewUI view for which to render the data. Determines the fields returned in the response. Options: desktop, mobile, both
Sys Parm TextSpecific text for which to search for in the category items. Example: sysparm_text="iPhone" or sysparm_text="Mobile devices"

Here is a sample JSON input:

{
  "Catalog sys_id": "e0d00659bba8fb4",
  "Category sys_id": "e079989wbba8fb4",
  "Sys Parm Limit": 10000,
  "Sys Parm Offset": 1000,
  "Sys Parm view": "desktop",
  "Sys Parm Text": "iPhone"
}

Response

The action returns a list of catalog items matching the specified criteria.

Submit Order

Submits an order for a specified catalog item. This process automates the ordering of specified catalog item for single or multiple users.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog (String)
Category sys_idSys_id of the category (String)
ItemSpecified catalog item for order

Optional

NameDescription
QuantityQuantity of the item
VariablesName-value pairs of all mandatory cart item variables. Mandatory variables are defined on the associated form
Sys Parm Request ForSys_id of the user for whom to order the specified item. Located in the User [sys_user] table
Sys Parm Also Request ForComma-separated string of user sys_ids of other users for which to order the specified item. User sys_ids are located in the User [sys_user] table

Here is a sample JSON input:

{
  "Catalog sys_id": "Technical Catalog",
  "Category sys_id": "Infrastructure",
  "Item": "Application Server (Standard)",
  "Quantity": 3,
  "Variables": {
    "division": "IT",
    "environment": "Dev",
    "purpose": "test"
  },
  "Sys Parm Request For": "[email protected]",
  "Sys Parm Also Request For": "Lana Keels ([email protected]), Toy Neel ([email protected])"
}

Response

Upon successful order submission, the action returns order confirmation details.

Submit Producer

Creates a table record (e.g., Service_request) directly from catalog. This action submits a producer request and returns the Table API relative path and redirect URL to access the created record.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog (String)
Category sys_idSys_id of the category (String)
ItemSpecified catalog item for order

Optional

NameDescription
VariablesName-value pairs of all mandatory cart item variables. Mandatory variables are defined on the associated form
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Valid values: desktop, mobile, both

Here is a sample JSON input:

{
  "Catalog sys_id": "Technical Catalog",
  "Category sys_id": "Infrastructure",
  "Item": "Application Server (Standard)",
  "Variables": {
    "urgency": "1",
    "comments": "test"
  },
  "Sys Parm View": "desktop"
}

Response

Upon successful submission, the action returns the Table API relative path and redirect URL to access the created record.

Get Item Detail

Retrieves detailed information for a specified catalog item. Here are some common use cases:

  • Retrieves a specified category item detail. This action is used by Virtual Assistant to fetch all the relevant attributes associated with an Item, and accordingly fetch information from the user

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Catalog sys_idSys_id of the catalog (String)
Category sys_idSys_id of the category (String)
ItemSpecified catalog item

Optional

NameDescription
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Valid values: desktop, mobile, both

Here is a sample JSON input:

{
  "Catalog sys_id": "Technical Catalog",
  "Category sys_id": "Infrastructure",
  "Item": "Application Server (Standard)",
  "Sys Parm View": "desktop"
}

Response

The action returns detailed information about the specified catalog item including all relevant attributes.

Get Catalogs

Retrieves a list of service catalogs to which the user has access based on the passed in parameters. Here are some common use cases:

  • A user can request Virtual Assistant to list all the Catalog categories which can be availed by the user

Input Parameters

Here are the input parameters required to set up this action:

Optional

NameDescription
Sys Parm LimitMaximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval
Sys Parm TextSpecific text for which to search for in the category items. Example: sysparm_text="iPhone" or sysparm_text="Mobile devices"
Sys Parm ViewUI view for which to render the data. Determines the fields returned in the response. Valid values: desktop, mobile, both

Here is a sample JSON input:

{
  "Sys Parm Limit": 10000,
  "Sys Parm Text": "iPhone",
  "Sys Parm View": "desktop"
}

Response

The action returns a list of catalogs accessible to the user.