Back to Search AI connectors listConnect ServiceNow to Search AI to let users search knowledge articles, incidents, and catalog items managed in ServiceNow. The connector supports real-time synchronization through webhook integration, keeping the Search AI index current with changes in ServiceNow.
Specification
Details
Repository type
Cloud
Supported content
Published Knowledge Articles, Incidents, Catalog Items
Skip this step if you are using Basic authentication.To use OAuth 2.0, set up an OAuth endpoint in your ServiceNow instance. Follow the ServiceNow documentation for instructions. Use the redirect URL for your region:
Step 2: Configure the ServiceNow Connector in Search AI
Select the ServiceNow connector from the list of available connectors.
Go to the Authorization tab and provide the following details.
Field
Description
Name
Unique name for the connector
Authorization Type
Basic or OAuth 2.0
Grant Type
For OAuth 2.0: Authorization Code (requires Client ID and Client Secret) or Password Grant Type (requires user credentials, Client ID, and Client Secret)
Host URL
Host of your ServiceNow instance
Real-Time Sync
Toggle to enable or disable automatic real-time sync via webhooks
Webhook Client Secret
Auto-generated; can be regenerated
Webhook URL
Copy this URL for use in ServiceNow Business Rules
Click Connect to authorize.
Go to the Configurations tab and click Sync Now to begin ingesting content.
By default, the connector ingests published knowledge articles, incidents, and catalog items.
Only articles within their validity date are ingested. Articles past their Valid To date are excluded.
Search AI supports webhook-based real-time sync with ServiceNow using Business Rules and a shared Script Include. Any create, update, or delete operation in ServiceNow is immediately reflected in the Search AI index.
A. Create the Shared Script IncludeIn System Definition > Script Includes, create a Script Include named SearchAIWebhookHandler. The script accepts a current record and operation type (insert, update, delete), then sends a POST request to the Search AI webhook endpoint with the authentication token.Sample script:
var <<CommonWebhookSender>> = Class.create();<<CommonWebhookSender>>.prototype = { initialize: function () {}, send: function (record, action) { try { var endpoint = 'https://<domain>/api/1.1/webhook/<streamId>/connector-Id'; var TOKEN = 'b59aebc4-xxx-xxx'; var payload = { source: 'servicenow', object: record.getTableName(), action: action, sys_id: record.sys_id.toString(), number: record.number ? record.number.toString() : '', knowledge_base_name: record.kb_knowledge_base ? record.kb_knowledge_base.getDisplayValue() : '' }; var r = new sn_ws.RESTMessageV2(); r.setHttpMethod('POST'); r.setEndpoint(endpoint); r.setRequestHeader('Content-Type', 'application/json'); r.setRequestHeader('X-Webhook-Token', TOKEN); r.setRequestBody(JSON.stringify(payload)); var response = r.execute(); gs.info('Webhook sent. Status: ' + response.getStatusCode()); } catch (e) { gs.error('Webhook error: ' + e.message); } }, type: '<<CommonWebhookSender>>'};
B. Create Business Rules (Per Table)In System Definition > Business Rules, create separate Business Rules for each supported table. Configure each rule to run after the database operation (Advanced rule, executes After). The script calls the SearchAIWebhookHandler Script Include with the current record and operation type.
Table
Trigger conditions
Knowledge Articles (kb_knowledge)
Insert, update, delete for published articles within validity period
Search AI supports advanced filters for content ingestion. Filtering is currently supported for Knowledge Articles only. Use article properties such as status, type, number, knowledge base, and source to selectively ingest content.Configure advanced filters:
Go to the Manage Content tab and select Ingest filtered content.
Click Edit configuration to open the Ingestion Filters page.
Use the Parameter, Operator, and Value fields to define a filter. Commonly used parameters appear in the dropdown. For the complete list, refer to the ServiceNow developer reference.
Example — ingest articles with a specific sys ID:Select Test and Save to apply the filter. It takes effect on the next scheduled or manual sync.Filter rules:
Multiple rules — Define one or more rules. Content matching any rule is ingested (logical OR).Example — select articles matching any sys ID from a list:
Multiple conditions — Each rule can have one or more conditions joined by logical AND. Content is selected only when all conditions are satisfied.Example — select published articles with a specific sys ID:
Real-time sync behavior:
Insert/Update — Document is created or updated in the Search AI index.
Delete — Corresponding content is removed from the index.
Search AI enforces access control at the knowledge base level for content ingested from ServiceNow.In ServiceNow, user access to knowledge base articles is defined by:
Owners of the knowledge base
Managers of the knowledge base
User Criteria with Can Read or Can Contribute permissions
User Criteria in ServiceNow groups users by conditions such as department or role, or by directly listing individual users.How Search AI handles these permissions:
Owners — Added directly to the sys_racl field.
Managers — Added directly to the sys_racl field.
Individual users listed under each User Criteria with Can Read or Can Contribute permissions.
Each User Criteria is retrieved as a Permission Entity. The Permission Entity ID is stored in the sys_racl field. Only users directly listed in the criteria are included automatically. Users added through other conditions (such as department or role) must be added manually using the Permission Entity APIs.Example sys_racl field for a knowledge article:
The alphanumeric value is the Permission Entity ID for the user criteria. Users directly listed in the criteria are automatically associated with this entity. To grant access to users added through other conditions, use the Permission Entity APIs.
Search AI enforces access control on incidents based on four categories:
Role-based access — Users with Base System Roles such as itil or itil_admin have access to incidents. A Permission Entity is created per role; associate users using the Permission Entity APIs.
ACL-based access — Users with access to the Incident Table (incident) through ACL configuration. A Permission Entity is created per ACL rule.
Assignment group-based access — Members of the incident’s assignment group automatically have access. A Permission Entity is created using the group ID.
Incident field-based access — Users linked to the incident through specific fields (Creator, Caller, Watch List) are added to sys_racl by email ID.
Webhook user sync — Search AI does not support user synchronization through webhooks. Document entities are updated in real time via webhook, but associated user permissions are not. User permission updates must be synchronized through the regular incremental or manual sync process.