ServiceNow
Watch the tutorial
Overview
The ServiceNow connector enables your Leena AI Agents to integrate with your organization's ServiceNow platform, facilitating automated IT service management workflows, table record operations, attachment handling, and service catalog fulfilment.
ServiceNow is a cloud-based platform that automates workflows for IT service management (ITSM) and various business functions, improving operational efficiency. The ServiceNow connector allows Leena AI to create and manage records in any ServiceNow table (incidents, requests, users, and more), work with attachments, and browse and order from the ServiceNow Service Catalog seamlessly.
API Details
Leena AI integrates with ServiceNow via REST APIs, including the Table API, Attachment API, and Service Catalog API.
Documentation link: https://developer.servicenow.com/dev.do#!/reference/api/latest/rest
Setup
The ServiceNow connector supports four authentication methods:
| Auth Type | Description |
|---|---|
| Basic auth | Authenticates using a ServiceNow username and password |
| OAuth 2.0 | Authenticates using an OAuth client (Client ID and Client Secret) along with a ServiceNow user's username and password (password grant type) |
| OAuth 2.0 client credentials | Authenticates using only the OAuth client's Client ID, Client Secret, and Scope (client credentials grant type) |
| Refresh token | Authenticates using the OAuth client's Client ID, Client Secret, and a long-lived Refresh token |
Prerequisites
Before setting up the ServiceNow connector, ensure you have:
- Administrator access to your ServiceNow instance
- Your ServiceNow instance Base URL (e.g.,
https://<instance-name>.service-now.com) - Access to System OAuth > Application Registry in ServiceNow (required for OAuth-based authentication methods)
- A ServiceNow integration user with the roles required for the tables and catalogs you want to access
- If your instance uses IP Address Access Control, the ability to allowlist Leena AI's IP addresses in ServiceNow
- Access to your Leena AI workspace with connector management permissions
Get credentials
For Basic auth:
- Log in to your ServiceNow instance as an administrator.
- Create (or identify) a dedicated integration user with the roles needed for the tables and catalog operations Leena AI will perform.
- Note down the username and password of this user.
For OAuth-based authentication (OAuth 2.0, OAuth 2.0 client credentials, Refresh token):
- Log in to your ServiceNow instance as an administrator.
- Navigate to System OAuth > Application Registry.
- Click New and select Create an OAuth API endpoint for external clients.
- Fill in the form:
- Name: Enter a descriptive name for the application (e.g., "Leena AI Integration")
- Client Secret: Leave blank — ServiceNow auto-generates it on save
- Optionally adjust the Access Token Lifespan and Refresh Token Lifespan to match your organization's token policies
- Click Submit to save the record.
- Reopen the record and copy the Client ID and Client Secret (the secret is hidden behind a lock icon).
- For the OAuth 2.0 client credentials grant type, ensure the client credentials grant is enabled on your instance and note the OAuth scope to be used (default:
useraccount). - For the Refresh token method, generate a refresh token by requesting a token from
https://<instance-name>.service-now.com/oauth_token.dousing the client credentials and a ServiceNow user's credentials, and note down the returned refresh token.
Add connection
Here is how to add a connection on Leena AI:
-
Log in to your Leena AI workspace
-
Navigate to Settings > Integrations
-
Search for "ServiceNow" and select it from the list to add its new connector
-
Start configuring the connector
- Base URL: Your ServiceNow instance URL, starting with http:// or https:// (e.g.,
https://<instance-name>.service-now.com) - Auth type: Select one of the supported authentication methods; the remaining fields depend on your selection
- Base URL: Your ServiceNow instance URL, starting with http:// or https:// (e.g.,
-
Fill in the authentication fields based on the selected auth type
Basic auth:
Field Description Username ServiceNow integration user's username Password ServiceNow integration user's password OAuth 2.0:
Field Description Client ID OAuth application client ID from the Application Registry Client secret OAuth application client secret from the Application Registry Username ServiceNow user's username (used for the password grant) Password ServiceNow user's password (used for the password grant) OAuth 2.0 client credentials:
Field Description Client ID OAuth application client ID from the Application Registry Client secret OAuth application client secret from the Application Registry Scope OAuth scope for the token request (pre-filled with the default scope) Refresh token:
Field Description Client ID OAuth application client ID from the Application Registry Client secret OAuth application client secret from the Application Registry Refresh token Long-lived refresh token generated from your ServiceNow instance -
Test and save the connection
- Leena AI validates the connection by calling the ServiceNow user table API
- If the test fails with an HTTP 403 error, your ServiceNow instance's IP Address Access Control is likely blocking the request — allowlist Leena AI's IP addresses in ServiceNow and retry
- Once the test succeeds, save the connector
Actions
The following actions are supported for the ServiceNow connector:
Tables: Get all tables
Retrieves the list of all tables available in the ServiceNow instance. This action can be leveraged by the Leena AI Orchestrator/Agent to discover the tables (e.g., incident, sc_request, sys_user) on which subsequent record operations can be performed.
Input Parameters
This action does not require any input parameters.
Response
The action returns the list of tables in the ServiceNow instance, including table names and labels.
Table records: Create table record
Creates a new record in a ServiceNow table. The Agent can leverage the skill (workflow), which has been designed to create records such as incidents or requests, once the user raises a query to do so. Here are some common use cases:
- Incident Creation: Raise a new incident when an employee reports an issue
- Request Logging: Create request records from conversational inputs
- Record Automation: Insert records into any custom table as part of a workflow
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Table name | The ServiceNow table in which the record will be created |
| Record fields | The field values for the new record; the available fields are determined dynamically by the selected table's form |
Optional
| Name | Description |
|---|---|
| Sys parm display value | Whether to return display values, actual values, or both for the record fields |
| Sys parm exclude reference link | Whether to exclude Table API links for reference fields in the response |
| Sys parm fields | Comma-separated list of fields to return in the response |
| Sys parm input display value | Whether the input field values are treated as display values or actual values |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both); determines the fields returned in the response |
Response
Upon successful creation, the action returns the created record's details, including its Sys ID and field values.
Table records: List table records
Retrieves multiple records from a ServiceNow table with support for filtering, pagination, and field selection. Here are some common use cases:
- My Tickets: List all incidents raised by an employee
- Open Items: Fetch records matching a status filter
- Reporting: Retrieve record sets for summaries and follow-ups
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Table name | The ServiceNow table from which records will be retrieved |
| Sys parm limit | Maximum number of records to return; for requests that exceed this number, use the offset parameter to paginate (pre-filled with a default value) |
| Sys parm offset | Starting record index from which to begin retrieving records; used for pagination (pre-filled with a default value) |
Optional
| Name | Description |
|---|---|
| Sys parm query available? | Toggle that switches the filter input between a name-value pairs form and a raw encoded query |
| Name value pairs query | List of field name and value pairs used to filter the records |
| Sys parm query | Encoded query string used to filter the records (available when the query toggle is enabled) |
| Sys parm display value | Whether to return display values, actual values, or both for the record fields |
| Sys parm exclude reference link | Whether to exclude Table API links for reference fields in the response |
| Sys parm fields | Comma-separated list of fields to return in the response |
| Sys parm no count | Whether to execute a count query on the table to return the number of rows |
| Sys parm query category | Name of the category to use for queries |
| Sys query no domain | Whether to restrict the record search to only the domains for which the logged-in user is configured |
| Sys parm suppress pagination header | Whether to remove the link header (pagination URLs) from the response |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both); determines the fields returned in the response |
Response
The action returns the list of matching records with their field values.
Table records: Get table record
Retrieves a single record from a ServiceNow table by its Sys ID. Here are some common use cases:
- Ticket Status: Fetch the current state of a specific incident
- Record Lookup: Retrieve full details of a record referenced in a conversation
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Table name | The ServiceNow table containing the record |
| Sys ID | The unique identifier of the record to be retrieved |
Optional
| Name | Description |
|---|---|
| Sys parm display value | Whether to return display values, actual values, or both for the record fields |
| Sys parm exclude reference link | Whether to exclude Table API links for reference fields in the response |
| Sys parm fields | Comma-separated list of fields to return in the response |
| Sys query no domain | Whether to restrict the record search to only the domains for which the logged-in user is configured |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both); determines the fields returned in the response |
Response
The action returns the requested record's details, including all requested field values.
Table records: Update table record
Updates an existing record in a ServiceNow table. Here are some common use cases:
- Ticket Updates: Update the state, assignment, or work notes of an incident
- Data Corrections: Modify field values on any table record as part of a workflow
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Table name | The ServiceNow table containing the record |
| Sys ID | The unique identifier of the record to be updated |
| Record fields | The field values to update; the available fields are determined dynamically by the selected table's form |
Optional
| Name | Description |
|---|---|
| Sys parm display value | Whether to return display values, actual values, or both for the record fields |
| Sys parm query no domain | Whether to restrict the record search to only the domains for which the logged-in user is configured |
| Sys parm fields | Comma-separated list of fields to return in the response |
| Sys parm input display value | Whether the input field values are treated as display values or actual values |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both); determines the fields returned in the response |
Response
Upon successful update, the action returns the updated record's details.
Attachment: Add attachment
Uploads an attachment to an existing record in a ServiceNow table. Here are some common use cases:
- Evidence Upload: Attach screenshots or documents to an incident
- Document Handling: Attach files collected during a conversation to a request record
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Table name | The ServiceNow table containing the record to which the attachment will be added |
| Table sys ID | The Sys ID of the record to which the attachment will be added |
| File name | Name of the file being attached |
| File data (URL/Base64) | The file content, provided either as a URL or as a Base64-encoded string |
Response
Upon successful upload, the action returns the attachment details, including its Sys ID and download link.
Attachment: Get attachment
Retrieves an attachment from ServiceNow by its Sys ID. Here are some common use cases:
- File Retrieval: Download a file attached to an incident or request
- Content Sharing: Fetch an attachment to share with an employee in a conversation
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Attachment sys ID | The unique identifier of the attachment to be retrieved |
Response
The action returns the attachment metadata and content.
Service catalog: Get catalogs
Retrieves the list of service catalogs available in the ServiceNow instance. Here are some common use cases:
- Catalog Discovery: List the catalogs an employee can order from
- Guided Ordering: Present available catalogs as the first step of an ordering workflow
Input Parameters
Here are the input parameters required to set up this action:
Optional
| Name | Description |
|---|---|
| Sys parm limit | Maximum number of catalogs to return (pre-filled with a default value) |
| Sys parm text | Keyword to search for in the title field of the available service catalogs |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the list of service catalogs with their titles and Sys IDs.
Service catalog: Get catalog detail
Retrieves the details of a specific service catalog. Here are some common use cases:
- Catalog Overview: Fetch the description and structure of a chosen catalog
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Catalog sys ID | The unique identifier of the service catalog to be retrieved |
Optional
| Name | Description |
|---|---|
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the details of the requested service catalog.
Service catalog: Get catalog catagories
Retrieves the categories within a specific service catalog. Here are some common use cases:
- Category Browsing: List the categories (e.g., Hardware, Software) inside a catalog
- Guided Ordering: Narrow down an employee's request to the right category
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Catalog sys ID | The unique identifier of the service catalog whose categories will be retrieved |
Optional
| Name | Description |
|---|---|
| Sys parm limit | Maximum number of categories to return (pre-filled with a default value) |
| Sys parm offset | Starting index from which to begin retrieving categories; used for pagination (pre-filled with a default value) |
| Sys parm top level only | Whether to return only top-level categories |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the list of categories in the catalog with their titles and Sys IDs.
Service catalog: Get category detail
Retrieves the details of a specific category within a service catalog.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Catalog sys ID | The unique identifier of the service catalog containing the category |
| Category sys ID | The unique identifier of the category to be retrieved |
Optional
| Name | Description |
|---|---|
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the details of the requested category.
Service catalog: Get category items
Retrieves the catalog items within a specific category. Here are some common use cases:
- Item Browsing: List the orderable items (e.g., laptops, software licenses) in a category
- Search: Find catalog items matching a keyword
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Catalog SysId | The unique identifier of the service catalog containing the items |
| Category sys ID | The unique identifier of the category whose items will be retrieved |
Optional
| Name | Description |
|---|---|
| Sys parm limit | Maximum number of items to return (pre-filled with a default value) |
| Sys parm offset | Starting index from which to begin retrieving items; used for pagination (pre-filled with a default value) |
| Sys parm text | Keyword to search for in the title field of the catalog items |
| Sys parm type | Type of catalog item to filter by |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the list of catalog items in the category with their titles and Sys IDs.
Service catalog: Get item detail
Retrieves the details of a specific catalog item, including the variables (form fields) required to order it. Here are some common use cases:
- Item Preview: Show an employee the details and required inputs of an item before ordering
- Dynamic Forms: Fetch item variables to drive a conversational ordering flow
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Item | The catalog item whose details will be retrieved |
Optional
| Name | Description |
|---|---|
| Catalog SysId | The service catalog used to filter the item selection |
| Category SysId | The category used to filter the item selection |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
The action returns the item details, including its description, pricing information, and variables.
Service catalog: Submit order
Submits an order for a catalog item on behalf of a user, creating a request in ServiceNow. Here are some common use cases:
- Hardware Requests: Order a laptop or accessory for an employee
- Software Requests: Order software licenses through the catalog
- On-behalf Ordering: Submit a request for another employee or a group of employees
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Item | The catalog item to be ordered |
| Quantity | The number of units of the item to order |
Optional
| Name | Description |
|---|---|
| Catalog SysId | The service catalog used to filter the item selection |
| Category SysId | The category used to filter the item selection |
| Variables form? | Toggle that switches the variables input between a dynamic form and a code/JSON input |
| Variables | The item's variable values; the available variables are determined dynamically by the selected catalog item |
| Request for | The user for whom the order is being requested |
| Also request for | Additional users for whom the order is being requested |
Response
Upon successful submission, the action returns the created request details, including the request number and Sys ID.
Service catalog: Submit producer
Submits a record producer in the service catalog, which creates a record (such as an incident or case) directly from a catalog form. Here are some common use cases:
- Report an Issue: Submit an incident through a record producer form
- HR/IT Case Creation: Create cases from conversational inputs via record producers
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Item | The record producer to be submitted |
Optional
| Name | Description |
|---|---|
| Catalog SysId | The service catalog used to filter the record producer selection |
| Category SysId | The category used to filter the record producer selection |
| Variables form? | Toggle that switches the variables input between a dynamic form and a code/JSON input |
| Variables | The record producer's variable values; the available variables are determined dynamically by the selected record producer |
| Sys parm view | UI view for which to render the data (desktop, mobile, or both) |
Response
Upon successful submission, the action returns the details of the record created by the record producer, including its number and Sys ID.
Updated 15 days ago
