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

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 searchindex 化済み case に対する自然言語 search
Case の作成short description、description、priority、category、caller を含む新規 case の作成
Case への replycase への 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_case table を作成する 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 を作成する​

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

  2. New をクリックしてから、Create API Key authentication profiles をクリックします。

  3. たとえば Squid API Key Profile のように 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 を step 1 の integration user に設定します。

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

  4. 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 も使用されません。

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

  2. Table API request に一致する可能性があるすべての policy を特定します。つまり REST API が Table API に設定されている policy と、Global が check されている policy です。

  3. これらの policy ごとに、Authentication Profiles related list を開き、step 2 の profile を追加します。

  4. 既存の authentication profile はそのままにします。

注記

policy では、それに attach された authentication method のみが許可されます。policy から Basic Auth または OAuth を削除すると、API 全体でそれらの method が disable されます。

Squid Application に ServiceNow CSM Connector を追加する​

  1. Squid Console の Connectors tab に移動します。

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

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

  4. 次の 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​

  1. Squid Console の Studio tab に移動します。

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

  3. "csm-agent" や "This agent helps the user manage ServiceNow customer service cases" などの agent ID と description を指定します。

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

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

  6. 「user が ServiceNow CSM で case または customer service task を管理したい場合にこれを call する」など、agent がこの connection を使用する方法の description を指定します。

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