ServiceNow CSM
ServiceNow Customer Service Management を Squid に接続し、case を検索、作成、管理します
ServiceNow CSM Connector の Functionality
ServiceNow CSM connector により、Squid AI agent は user に代わって Customer Service Management case を操作できます。
| Capability | 説明 |
|---|---|
| Case の検索 | short description、description、case number による case の text search。state で optional に filter 可能 |
| Case detail の取得 | caller、assignee、comment、work note を含む完全な case detail |
| Semantic search | index 化済み case に対する自然言語 search |
| Case の作成 | short description、description、priority、category、caller を含む新規 case の作成 |
| Case への reply | case への public comment または internal work note の追加 |
Squid は CSM case を自動的に knowledge base に sync し、10 分ごとに refresh します(initial sync では過去 1 年間の case history が対象です)。これにより semantic search capability が有効になります。
connector は ServiceNow Customer Service Management case(sn_customerservice_case table)で機能します。ITSM incident は管理しません。
ServiceNow REST API Key の作成
connector は、すべての request で x-sn-apikey header として送信される ServiceNow API key を使用して authenticate します。setup には ServiceNow で 4 つの record が必要で、4 つすべてが存在するまで key は無効です。
前提条件
- ServiceNow Washington DC 以降。API key authentication は以前の release には存在しません。release は
https://YOUR_INSTANCE.service-now.com/stats.doで確認します。 - All > Admin Center > Application Manager で active にする API Key and HMAC Authentication plugin(
com.glide.tokenbased_auth)。 sn_customerservice_casetable を作成する Customer Service Management plugin(com.sn_customerservice)。
1. Integration User を作成する
All > User Administration > Users で dedicated user を作成し、sn_customerservice_agent role と、case table に必要な ACL に応じた追加 role を付与します。API key はこの user の access を継承するため、connector が実際に実行する操作、つまり case、comment、work note の read に必要な範囲に role を scope します。
2. Inbound Authentication Profile を作成する
-
All > System Web Services > API Access Policies > Inbound Authentication Profile に移動します。
-
New をクリックしてから、Create API Key authentication profiles をクリックします。
-
たとえば
Squid API Key Profileのように profile に名前を付けます。 -
Auth Parameter で
x-sn-apikeyの header record を選択します。 -
Submit をクリックします。
query parameter record ではなく、header record を選択してください。connector は key を header としてのみ送信するため、query parameter に紐付けた profile は一致しません。Auth Parameter field が空の場合、profile は無効になり 401 response が発生します。
3. REST API Key を作成する
-
All > System Web Services > API Access Policies > REST API Key に移動します。
-
New をクリックし、key に名前を付け、User を step 1 の integration user に設定します。
-
Submit をクリックしてから record を再度開き、token を表示します。
-
token を copy します。これは Squid に paste する value です。
4. Table API を対象とするすべての Policy に Profile を Attach する
ServiceNow は REST API Access Policy を specificity に基づいて評価し、最も specific な single match のみを適用します。大部分の instance には Table API をすでに対象とする seeded policy が含まれているため、新しい broad policy を作成しても通常は何も実現できません。seeded policy が優先され、作成した policy は評価されず、API key も使用されません。
-
All > System Web Services > API Access Policies > REST API Access Policies に移動します。
-
Table API request に一致する可能性があるすべての policy を特定します。つまり REST API が Table API に設定されている policy と、Global が check されている policy です。
-
これらの policy ごとに、Authentication Profiles related list を開き、step 2 の profile を追加します。
-
既存の authentication profile はそのままにします。
policy では、それに attach された authentication method のみが許可されます。policy から Basic Auth または OAuth を削除すると、API 全体でそれらの method が disable されます。
Squid Application に ServiceNow CSM Connector を追加する
-
Squid Console の Connectors tab に移動します。
-
Available Connectors をクリックします。
-
ServiceNow - CSM connector を見つけ、Add Connector を選択します。
-
次の configuration detail を指定します。
Connector ID: code 内で connector を一意に識別する string。
Instance Domain: ServiceNow instance の subdomain。たとえば、instance が https://mycompany.service-now.com にある場合、mycompany を入力します。
REST API Token: 上記で作成した API key token。token は Squid secret として安全に保存されます。
Application で ServiceNow CSM Connector を使用する
No-code Studio
-
Squid Console の Studio tab に移動します。
-
Create AI Agent をクリックします。
-
"csm-agent"や"This agent helps the user manage ServiceNow customer service cases"などの agent ID と description を指定します。 -
Add Abilities をクリックします。
-
ServiceNow - CSM entry を expand し、先ほど作成した connector を選択します。
-
「user が ServiceNow CSM で case または customer service task を管理したい場合にこれを call する」など、agent がこの connection を使用する方法の description を指定します。
-
Test をクリックし、agent に「What are the open cases?」と尋ねてみます。
Squid SDK を使用する
Squid SDK を使用して AI agent を作成する場合は、ask() function の connectedIntegrations option に connector を追加して接続します。
- 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',
}
]
},
)
npm Package を使用する
backend または client code から programmatic(non-agent)access を行うには、@squidcloud/servicenow_csm-client package を install します。
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 は priority に numeric code(1 = Critical ~ 5 = Planning)、case state に numeric code(1 = New、2 = In Progress、3 = On Hold、6 = Resolved、7 = Closed、8 = Canceled)を使用します。