# ServiceNowでのインシデント作成

{% hint style="warning" %}
このドキュメントは外部ソースを参照しています。

Nexthink は、サードパーティのドキュメントの正確性や、不整合を引き起こす可能性のある外部の更新を管理していません。

エラーや不整合を発見した場合は、[Nexthinkサポート](https://support.nexthink.com/) に報告してください。
{% endhint %}

このドキュメントは、Nexthink Webhookを設定して、アラートやイベントを検出し、それをServiceNowに転送してインシデントを作成する方法を示しています。

## ServiceNowで <a href="#creatinganincidentinservicenow-inservicenow" id="creatinganincidentinservicenow-inservicenow"></a>

Nexthinkで資格情報を定義するために、ユーザーの適切なロールが設定されていることを確認してください。

1. **ユーザー管理**に入り、**ユーザー**を選択します。
2. ユーザーに次のロールが割り当てられていることを確認します:
   * `rest_api_explorer`
   * `itil`
3. ユーザーがServiceNowに設定された後、**システムWebサービス** > **REST**の順に選択し、**Rest API Explorer**を選択します。
4. 次の値を選択していることを確認します:
   * Namespace = now
   * API 名 = Table API
   * API バージョン = latest
5. \*\*レコードの作成 (POST)\*\*オプションをクリックします。
6. **リクエストの準備**セクションで、**テーブル名**にドロップダウンリストから**インシデント**を選択します。

<div align="left"><figure><img src="/files/1qFdQKkJGZTCr8qmYrQh" alt="Prepare request"><figcaption></figcaption></figure></div>

7. 今後の参照のために、**レコード作成**情報をコピーして保存してください。 つまり、NexthinkのWebインターフェースでの[コネクター資格情報の設定](#configuring-a-connector-credential-for-the-servicenow-incident-creation)と[Webhook設定](#configuring-a-webhook-for-servicenow-incident-creation)です。

<figure><img src="/files/FcterUkdeIk6v0R64VVI" alt=""><figcaption></figcaption></figure>

8. **リクエストボディ**セクションに移動し、ページ下部にある**ビルダータブ**を選択します。

<figure><img src="/files/ccTXjdF0epUVAV0NANgY" alt="Builder tab"><figcaption></figcaption></figure>

9. **リクエストボディ**を作成するために**フィールドを追加**して、将来の参照のために保存します。 つまり、NexthinkのWebインターフェースでのWebhook設定です。
   * たとえば、`caller`、`impact`、`urgency`、`business service`、`configuration item`、`short description`と`description`のフィールドを持つインシデントを作成するために、ドロップダウンメニューを使用してServiceNowから適切なフィールドを選択し、テキストを入力してそれらに値を割り当てます。
   * オプションで、プラスボタンを使用してServiceNowのリクエストにさらに多くのフィールドを追加して、必要なだけ新しい行を作成します。

<figure><img src="/files/6n1OpjeCxmpco58c1mwJ" alt="Assign values to fields"><figcaption></figcaption></figure>

以下にServiceNowでの**リクエストボディ**の例を示します:

```
{
 "short_description":"Nexthink Alertによって作成された問題です",
 "description":"Nexthink Alert {{alert.monitor.name}} がトリガーされました",
 "impact":"2",
 "urgency":"2",
 "cmdb_ci":"{{device.device.name}}",
 "caller_id":"Nexthink Integration"
}
```

{% hint style="info" %}
ペイロードでのプレースホルダーとしてのデータモデル変数の使用については、[Webhookフィールドの構成: メソッド、リソース、およびペイロード](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/managing-webhooks/configuring-webhook-fields_-method-resource-and-payload.md#configuringwebhookfields-method-resource-andpayload-usingdatamodelvariablesasplaceholdersinthepayloa)を参照してください。
{% endhint %}

## Nexthinkで <a href="#creatinganincidentinservicenow-innexthink" id="creatinganincidentinservicenow-innexthink"></a>

NexthinkのWebインターフェースから:

* [ServiceNowインシデント作成用のコネクター資格情報を設定する](#configuring-a-connector-credential-for-the-servicenow-incident-creation)
* [ServiceNowインシデント作成用のWebhookを設定する](#configuring-a-webhook-for-servicenow-incident-creation)

### ServiceNowインシデント作成用のコネクター資格情報の設定 <a href="#configuring-a-connector-credential-for-the-servicenow-incident-creation" id="configuring-a-connector-credential-for-the-servicenow-incident-creation"></a>

[コネクター資格情報](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/connector-credentials.md)設定ページから、ServiceNowで作成した接続情報を使用してフィールドを入力します。

1. **プロトコル**のドロップダウンから**HTTPS**オプションを選択します。
2. **URLアドレス**フィールドに[ServiceNow](#creatinganincidentinservicenow-inservicenow)から**レコード作成**URL `https://venXXXXX.service-now.com/` を貼り付けます。
3. **認証**のドロップダウンから**基本**オプションを選択します。
4. サードパーティツールに接続するための**ユーザー名**と**パスワード**を入力します。
5. 資格情報を**保存**します。

### ServiceNowインシデント作成用のWebhookの設定 <a href="#configuring-a-webhook-for-servicenow-incident-creation" id="configuring-a-webhook-for-servicenow-incident-creation"></a>

[Webhook設定ページ](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/managing-webhooks.md#managingwebhooks-creatinganewwebhook)から、[ServiceNow](#creatinganincidentinservicenow-inservicenow) REST API Explorerのセットアップ情報を使用してフィールドを入力します。

1. [WebhookのNQL条件を構成する](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/managing-webhooks/configuring-webhook-nql-conditions.md)ドキュメントに従って**NQL条件**を入力します。 以下のクエリを参照してください。
   * NQL条件を入力した後、システムは**ペイロード**用の[許可されたプレースホルダー](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/managing-webhooks/configuring-webhook-fields_-method-resource-and-payload.md#configuringwebhookfields-method-resource-andpayload-usingdatamodelvariablesasplaceholdersinthepayloa)を一覧表示します。

```
alert.alerts
| list alert.monitor.name, alert.status, monitor.tags, alert.context, trigger_time, recovery_time, alert.monitor.thresholds, monitor.priority, alert.trigger_values, alert.trigger_reference_value, alert.recovery_values, alert.context, device_view_link, issue_view_link, device.name
```

2. ServiceNow用に作成したコネクター資格情報を**資格情報**ドロップダウンから選択します。
3. **メソッド**のドロップダウンから**POST**を選択します。
4. ServiceNowからの**レコード作成**URLをコピーして、URLアドレスを除いた**リソース**フィールドに貼り付けます。 例えば: `api/now/table/incident`
   * `{tableName}`をServiceNowの**テーブル名**に適切な**クエリパラメーター**で置き換えることを忘れないでください。 この場合は、`incident`です。
5. ServiceNowで作成した**リクエストボディ**で**ペイロード**フィールドに貼り付けます。 フォーマットは不要です。 以下の例を参照してください。

```
{
  "short_description":"Nexthink Alertによって作成された問題です",
  "description":"Nexthink Alert {{alert.monitor.name}} がトリガーされました",
  "impact":"2",
  "urgency":"2",
  "cmdb_ci":"{{device.device.name}}",
  "caller_id":"Nexthink Integration"
}
```

{% hint style="info" %}
ペイロードでのプレースホルダーとしてのデータモデル変数の使用については、[Webhookフィールドの構成: メソッド、リソース、およびペイロード](/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/managing-webhooks/configuring-webhook-fields_-method-resource-and-payload.md#configuringwebhookfields-method-resource-andpayload-usingdatamodelvariablesasplaceholdersinthepayloa)を参照してください。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks/webhook-use-cases-setup/creating-an-incident-in-servicenow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
