---
title: Integrate ServiceNow with Datadog On-Call
description: >-
  Create ServiceNow incidents from On-Call Pages, keep them in sync, and trigger
  Pages from ServiceNow incidents.
breadcrumbs: >-
  Docs > Incident Response > On-Call > On-Call Integrations > Integrate
  ServiceNow with Datadog On-Call
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Integrate ServiceNow with Datadog On-Call

{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, app.ddog-gov.com

{% callout %}
##### Join the Preview

The ServiceNow integration for Datadog On-Call is in Preview.

[Request Access](https://www.datadoghq.com/product-preview/on-call-integrations/)
{% /callout %}

{% /callout %}

## Overview{% #overview %}

The ServiceNow integration for Datadog On-Call connects On-Call Pages with ServiceNow incidents. It supports two flows:

- **Sync Pages to ServiceNow**: When a routing rule creates a Page, Datadog creates a ServiceNow incident and keeps it in sync with the Page. Status, urgency, and comments sync based on the mappings you configure.
- **Trigger Pages from ServiceNow**: When a ServiceNow record matches a business rule, the rule triggers a Page for a Datadog On-Call team or user.

## Prerequisites{% #prerequisites %}

- Make sure you have the [On-Call Admin (`on_call_admin`)](https://docs.datadoghq.com/account_management/rbac/permissions.md#on-call) permission, which you need to create ServiceNow connections in On-Call settings.
- Complete the [ServiceNow ITOM/ITSM setup](https://docs.datadoghq.com/integrations/guide/servicenow-itom-itsm-setup.md):
  1. Configure the ServiceNow tile and install version 2.9.3 or later of the ITOM/ITSM Integration for Datadog.
  1. Complete the steps in [Sync data bidirectionally between ServiceNow and Datadog](https://docs.datadoghq.com/integrations/guide/servicenow-itom-itsm-setup.md#sync-bidirectionally). Both flows on this page use the credentials from that configuration.

## Sync Pages to ServiceNow incidents{% #sync-pages-to-servicenow-incidents %}

### Create a ServiceNow connection{% #create-a-servicenow-connection %}

A connection defines which ServiceNow instance receives incidents and how Pages and incidents stay in sync. You can create more than one connection, for example, one for each assignment group.

1. In Datadog, go to [**On-Call > Settings > Integrations**](https://app.datadoghq.com/on-call/settings/integrations).
1. Select **ServiceNow** and click **Add Connection**.
1. Configure the connection:
   - **ServiceNow instance**: Select the ServiceNow instance configured in the ServiceNow tile. To add an instance, click **Manage accounts**.
   - **Assignment group** (optional): Select the ServiceNow assignment group for incidents created from Pages.
   - **Automatically create ServiceNow incidents from Pages**: Enable this toggle to create a ServiceNow incident each time a routing rule that uses this connection creates a Page.
   - **Sync methods and mappings**: Choose how each field syncs between the Page and the ServiceNow incident, and map its values. You can sync the Page's status to the incident's **State**, its urgency to the incident's **Impact** and **Urgency**, and its comments to the incident's **Work Notes**.
1. Save the connection.

### Sync Pages from a routing rule{% #sync-pages-from-a-routing-rule %}

After you create a connection, add ServiceNow sync to a team's [routing rules](https://docs.datadoghq.com/incident_response/on-call/routing_rules.md):

1. Go to [**On-Call > Teams**](https://app.datadoghq.com/on-call/teams) and select a team.
1. Find the **Page Routing** section and click **Edit**.
1. Add or edit a routing rule.
1. Under **Set targets**, click **Add**, select **Sync with a ServiceNow Incident**, then select the connection to use.
1. Save the routing rule.

When the rule matches an alert, Datadog creates the Page and a ServiceNow incident at the same time. The incident stays in sync with the Page based on the connection's settings.

## Trigger Pages from ServiceNow incidents{% #trigger-pages-from-servicenow-incidents %}

The ITOM/ITSM Integration for Datadog includes a `PublishOnCallPage` script. Call it from a ServiceNow business rule to trigger an On-Call Page, for example, when an incident is created.

1. In ServiceNow, go to **System Definition > Business Rules** and click **New**.

1. Configure the business rule's table, when it runs, and its filter conditions to define which records trigger a Page. Select the **Advanced** checkbox to enable scripting.

1. On the **Advanced** tab, call `PublishOnCallPage` in the script. For example, to page the `database` team at high urgency:

   ```javascript
   (function executeRule(current, previous /* null when async */) {
       new PublishOnCallPage("team_handle", "database", "high").execute(current);
   })(current, previous);
   ```

For the supported target types, the urgency argument, and the application key scopes the script requires, see [Create a Datadog On-Call Page from ServiceNow](https://docs.datadoghq.com/integrations/guide/servicenow-itom-itsm-setup.md#create-on-call-page).

1. Click **Submit**.

When the business rule runs, Datadog triggers a Page for the target team or user.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Install the ServiceNow integration](https://docs.datadoghq.com/integrations/servicenow.md)
- [Set up ServiceNow ITOM and ITSM](https://docs.datadoghq.com/integrations/guide/servicenow-itom-itsm-setup.md)
- [Routing Rules](https://docs.datadoghq.com/incident_response/on-call/routing_rules.md)
- [On-Call Integrations](https://docs.datadoghq.com/incident_response/on-call/integrations.md)
