メインコンテンツまでスキップ

ServiceNow CSM

ServiceNow Customer Service Management を Squid に接続して、case の検索、作成、管理を行う

ServiceNow CSM connector の機能

ServiceNow CSM connector により、Squid AI agent はユーザーに代わって Customer Service Management cases を操作できます。

機能説明
case の検索short description、description、または case number による case のテキスト検索。必要に応じて state で絞り込み
case 詳細の取得caller、assignee、comments、work notes を含む完全な case 詳細
セマンティック検索index 化された cases に対する自然言語検索
case の作成short description、description、priority、category、caller を指定して新しい case を作成
case への返信case に public comment または internal work note を追加

Squid は CSM cases を自動的に knowledge base に同期し、10 分ごとに更新します(初回同期では過去 1 年分の case 履歴が対象です)。これによりセマンティック検索機能が有効になります。

注記

この connector は ServiceNow Customer Service Management cases(sn_customerservice_case table)で動作します。ITSM incidents は管理しません。

ServiceNow REST API key の作成

この connector は ServiceNow API key で認証します。API key はすべての request で x-sn-apikey header として送信されます。設定には ServiceNow で 4 つの record が必要で、4 つすべてが存在するまで key は無効なままです。

前提条件

  • ServiceNow Washington DC 以降。API key authentication はそれ以前の release には存在しません。https://YOUR_INSTANCE.service-now.com/stats.do で release を確認してください。
  • API Key and HMAC Authentication plugin(com.glide.tokenbased_auth)。All > Admin Center > Application Manager で有効化されていること。
  • Customer Service Management plugin(com.sn_customerservice)。これにより sn_customerservice_case table が作成されます。

1. integration user を作成する

All > User Administration > Users で専用 user を作成し、sn_customerservice_agent role に加えて、case tables に対して ACL が必要とする追加の role を付与します。API key はこの user の access を継承するため、role は connector が実際に行う操作(cases、comments、work notes の読み取り)に合わせて範囲を限定してください。

2. inbound authentication profile を作成する

  1. All > System Web Services > API Access Policies > Inbound Authentication Profile に移動します。

  2. New をクリックし、次に Create API Key authentication profiles をクリックします。

  3. profile に名前を付けます。例: Squid API Key Profile

  4. Auth Parameter で、x-sn-apikey header record を選択します。

  5. Submit をクリックします。

警告

query parameter record ではなく、header record を選択してください。この connector は key を header としてのみ送信するため、query parameter に紐づいた profile は一致しません。Auth Parameter field が空の場合、profile は無効になり、401 response が発生します。

3. REST API key を作成する

  1. All > System Web Services > API Access Policies > REST API Key に移動します。

  2. New をクリックし、key に名前を付け、User を手順 1 の integration user に設定します。

  3. Submit をクリックし、record を再度開いて token を表示します。

  4. token をコピーします。これが Squid に貼り付ける必要がある値です。

4. Table API を対象とするすべての policy に profile をアタッチする

ServiceNow は REST API Access Policies を具体性に基づいて評価し、最も具体的に一致する単一の policy のみを適用します。ほとんどの instance には Table API をすでに対象とする seeded policies が含まれているため、新しい広範な policy を作成しても通常は何も達成されません。seeded policy が優先され、作成した policy は評価されず、API key も参照されません。

  1. All > System Web Services > API Access Policies > REST API Access Policies に移動します。

  2. Table API request に一致する可能性があるすべての policy を特定します。REST APITable API に設定されている policy、および Global がチェックされている policy が対象です。

  3. それぞれの policy で、Authentication Profiles related list を開き、手順 2 の profile を追加します。

  4. 既存の authentication profiles はそのまま残します。

policy は、それにアタッチされた authentication methods のみを許可します。policy から Basic Auth または OAuth を削除すると、その API 全体でそれらの method が無効になります。

ServiceNow CSM connector を Squid application に追加する

  1. Squid ConsoleConnectors tab に移動します。

  2. Available Connectors をクリックします。

  3. ServiceNow - CSM connector を見つけ、Add Connector を選択します。

  4. 次の configuration details を入力します。

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

  1. Squid ConsoleStudio tab に移動します。

  2. Create AI Agent をクリックします。

  3. agent IDdescription を入力します。例: "csm-agent"、"This agent helps the user manage ServiceNow customer service cases"。

  4. Add Abilities をクリックします。

  5. ServiceNow - CSM entry を展開し、先ほど作成した connector を選択します。

  6. agent がこの connection をどのように使用すべきかの description を入力します。例: "Call this when a user wants to manage cases or customer service tasks in ServiceNow CSM."

  7. Test をクリックし、agent に "What are the open cases?" と質問してみます。

Squid SDK の使用

Squid SDK で AI agent を作成する場合は、ask() function の connectedIntegrations option に追加して connector を接続します。

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',
},
],
});

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(1 = Critical から 5 = Planning)および case state(1 = New、2 = In Progress、3 = On Hold、6 = Resolved、7 = Closed、8 = Canceled)に numeric codes を使用します。