ServiceNow¶
Connect HolmesGPT to ServiceNow to analyze ITSM data via the Table API. Query changes, incidents, configuration items, and other tables to investigate infrastructure issues.
Prerequisites¶
- A ServiceNow instance
- Admin access to configure API authentication
Setup Instructions¶
Follow these steps to configure API access in your ServiceNow instance. For detailed instructions, see the ServiceNow API Key Configuration Guide.
1. Create an Inbound Authentication Profile¶
- Navigate to All > System Web Services > API Access Policies > Inbound Authentication Profiles
- Click New
- Select Create API Key authentication profiles
- In the Auth Parameter field, add:
x-sn-apikey: Auth Header - Submit
2. Create a REST API Key¶
- Navigate to All > System Web Services > API Access Policies > REST API Key
- Click New
- Select the User account that will be used for API access
- Submit
- Open the created record to copy the generated API token - you'll use this as the
api_keyin the configuration below
Important
The selected user's permissions determine which tables and records HolmesGPT can access. Ensure the user has appropriate read permissions for the tables you want to query.
3. Create REST API Access Policy¶
- Navigate to All > System Web Services > REST API Access Policies
- Click New
- Configure:
- REST API: Select "Table API"
- Apply to all tables: Leave this checked (recommended)
- Authentication Profile: Select the profile created in Step 1
- Apply to all methods: Uncheck this option, then select "GET" from the HTTP Method dropdown that appears
- Submit
Tip
Enable "Apply to all tables" for best results. Limiting access to specific tables reduces HolmesGPT's investigative capabilities.
4. Test Your Configuration¶
Verify your setup with either of these test queries:
# Test with incident table
curl -X GET "https://<your-instance>.service-now.com/api/now/table/incident?sysparm_limit=1" \
-H "Accept: application/json" \
-H "x-sn-apikey: <your-api-key>"
# Or test with system table (always has data)
curl -X GET "https://<your-instance>.service-now.com/api/now/table/sys_db_object?sysparm_limit=1" \
-H "Accept: application/json" \
-H "x-sn-apikey: <your-api-key>"
You should receive a JSON response. If you get an authentication error, check your API key and permissions.
Configuration¶
Add the following to ~/.holmes/config.yaml. Create the file if it doesn't exist:
toolsets:
servicenow/tables:
enabled: true
config:
api_key: <your servicenow API key> # e.g. now_1234567890abcdef
instance_url: <your servicenow instance URL> # e.g. https://dev12345.service-now.com
After making changes to your configuration, run:
To test, run:
Capabilities¶
| Tool Name | Description |
|---|---|
| servicenow_get_records | Query multiple records from any ServiceNow table with powerful filtering, sorting, and field selection capabilities |
| servicenow_get_record | Retrieve a single record by its sys_id with full details from any accessible table |