ServiceNow CSM
Connect ServiceNow Customer Service Management to Squid to search, create, and manage cases
The ServiceNow CSM connector's functionality
The ServiceNow CSM connector enables Squid AI agents to work with Customer Service Management cases on the user's behalf:
| Capability | Description |
|---|---|
| Search cases | Text search of cases by short description, description, or case number, optionally filtered by state |
| Get case details | Full case details including caller, assignee, comments, and work notes |
| Semantic search | Natural-language search over indexed cases |
| Create cases | Create a new case with a short description, description, priority, category, and caller |
| Reply to cases | Add a public comment or an internal work note to a case |
Squid automatically syncs your CSM cases into a knowledge base, refreshing every 10 minutes (the initial sync covers the last year of case history), which enables the semantic search capability.
The connector works with ServiceNow Customer Service Management cases (the sn_customerservice_case table). It does not manage ITSM incidents.
Creating a ServiceNow REST API token
The connector authenticates using a ServiceNow REST API token:
-
In your ServiceNow instance, navigate to System Security > REST API Token.
-
Create a token. The user associated with the token needs access to the Customer Service Management case tables.
-
Copy the token value.
Adding the ServiceNow CSM connector to your Squid application
-
Navigate to the Connectors tab in the Squid Console.
-
Click Available Connectors.
-
Find the ServiceNow - CSM connector, and select Add Connector.
-
Provide the following configuration details:
Connector ID: A string that uniquely identifies the connector in your code.
Instance Domain: The subdomain of your ServiceNow instance. For example, if your instance is at https://mycompany.service-now.com, enter mycompany.
REST API Token: The REST API token generated in your ServiceNow instance. The token is stored securely as a Squid secret.
Using the ServiceNow CSM connector in your application
No-code Studio
-
Navigate to the Studio tab in the Squid Console.
-
Click Create AI Agent.
-
Provide an agent ID and description, such as "csm-agent" and "This agent helps the user manage ServiceNow customer service cases".
-
Click Add Abilities.
-
Expand the ServiceNow - CSM entry and select the connector you created earlier.
-
Give a description for how the agent should use this connection, such as "Call this when a user wants to manage cases or customer service tasks in ServiceNow CSM."
-
Click on Test and try asking the agent "What are the open cases?".
Using the Squid SDK
If you are creating your AI agent with the Squid SDK, connect the connector by adding it to the connectedIntegrations option of the ask() function:
- TypeScript
- Python
await this.squid
.ai()
.agent('AGENT_ID')
.ask('Summarize the most recent customer cases about billing', {
connectedIntegrations: [
{
integrationId: 'SERVICENOW_CONNECTOR_ID',
integrationType: 'servicenow_csm',
description: 'Call this connector to manage ServiceNow CSM cases',
},
],
});
await squid.ai().agent('AGENT_ID').ask(
'Summarize the most recent customer cases about billing',
options={
'connectedIntegrations': [
{
'integrationId': 'SERVICENOW_CONNECTOR_ID',
'integrationType': 'servicenow_csm',
'description': 'Call this connector to manage ServiceNow CSM cases',
}
]
},
)
Using the npm package
For programmatic (non-agent) access from your backend or client code, install the @squidcloud/servicenow_csm-client package:
npm install @squidcloud/servicenow_csm-client
import { SquidServiceNowCSMClient } from '@squidcloud/servicenow_csm-client';
const servicenow = new SquidServiceNowCSMClient(squid, 'SERVICENOW_CONNECTOR_ID');
// Search and inspect cases
const cases = await servicenow.searchCases('billing');
const details = await servicenow.getCase(cases[0].number);
// Create a case and reply to it
const created = await servicenow.createCase({ shortDescription: 'Billing discrepancy' });
await servicenow.replyToCase(created.number, 'We are investigating.', true);
ServiceNow uses numeric codes for priority (1 = Critical through 5 = Planning) and case state (1 = New, 2 = In Progress, 3 = On Hold, 6 = Resolved, 7 = Closed, 8 = Canceled).