Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

ServiceNow’s ITOM/ITSM integration allows you to send alerts, cases, and incidents generated in Datadog to ServiceNow as records in the Incident or Event tables. The integration relies on interim tables and transform maps.

To use the integration, follow the instructions to install the integration, and then configure the integration for each product:

  1. Install the ITOM/ITSM integration
  2. Configure the integration
    1. Configure Datadog templated monitor notifications
    2. Configure Datadog Case Management
    3. Configure Datadog Incident Management
  3. Customize data with transform maps

Install the ITOM/ITSM integration

There are two ways to install the integration:

Before proceeding, make sure you have added your ServiceNow instance into your ServiceNow tile in Datadog.

Configure the integration

Configure templated monitor notifications

These features require ITOM/ITSM integration version 2.6.0 or newer.

Configure instance priority mapping

By default, Datadog doesn’t include ServiceNow impact and urgency levels when sending events to ServiceNow. For each ServiceNow configuration, you can configure mappings between those ServiceNow levels and Datadog’s Monitor Priority levels for inclusion in Datadog-generated events.

  1. In Datadog, go to the ServiceNow integration settings page.
  2. Go to the Configure tab, then the ITOM/ITSM tab, then the Monitors tab.
  3. Under Instance Priority Mapping for Templates, open the settings for your ServiceNow instance.
  4. Turn on the Use Instance Priority Mapping toggle.
  5. Under ServiceNow Urgency and ServiceNow Impact, select the levels you want to correspond with Datadog’s Monitor Priority levels. For example:
    • Impact: 4
    • Urgency: 5
  6. Click Update.

Create a custom ServiceNow @-handle for monitor notifications

To create a ServiceNow record from a monitor, you need to configure an @-handle to use within the monitor notification rules or notification recipients.

  1. In Datadog, go to the ServiceNow integration settings page.
  2. Go to the Configure tab, then the ITOM/ITSM tab, then the Monitors tab.
  3. Beside Templates, click + New to create a new template.
  4. Define an @-handle Name, Instance, and Target Table for the monitor notification to be delivered to.
  5. (Optional) Set Assignment Group, Business Service, and/or User in the template.
    Note: If you set both an assignment group and user, the user must belong to the selected assignment group for the ServiceNow record creation to successfully complete.
  6. (Optional) Expand the Customize notification payload section and click Add field to add more variables from Datadog.
  7. Click Save.

To use the new template, add @servicenow-<TEMPLATE_NAME> in a monitor description. When the monitor alerts, ServiceNow also creates a corresponding record, and automatically sets it to Resolved when the underlying alert recovers.

To configure legacy monitor notifications using @servicenow-<INSTANCE_NAME>:

  1. In Datadog, go to the ServiceNow integration settings page.

  2. Go to the Configure tab, then the ITOM/ITSM tab, then the Monitors tab.

  3. Under Manage Legacy Monitor Notifications, select the instance you want to configure notifications for, then select the table that legacy monitor notifications write to.

  4. To validate the integration is set up correctly, add @servicenow-<INSTANCE_NAME> in a monitor or event notification. You can define both the Impact and Urgency values so ServiceNow can use them to calculate the incident priority. The raw data populates rows in the interim table and is forwarded to the ServiceNow table specified by the integration.

    Example legacy monitor with defined Impact and Urgency values
  5. Use transform maps in ServiceNow to customize the transformation of the data sent to the interim tables.

  6. Customize the notification payload with available Datadog variables or custom strings.

Note: Impact and Urgency in monitor descriptions work only for legacy monitor configurations. For templated monitors, configure instance priority mapping. The priority field in ServiceNow incidents is read-only, and can only be updated using priority lookup rules.

action
Type: String
The action being taken on the monitor: create, update, acknowledge, or resolve
additional_information
Type: String
ITOM Transform: additional_info
Formatted string containing all event details
aggreg_key
Type: String
Aggregation key representing a hash of the alerting monitor’s ID
alert_cycle_key
Type: String
Key representing a hash of a single monitor’s alert cycle (tracks Alert → Warn → Resolve)
alert_id
Type: String
ID of the alerting monitor
alert_metric
Type: String
ITOM Transform: metric_name
Metric that triggered the alert
alert_query
Type: String
Query that triggered the alert
alert_scope
Type: String
Scope that triggered the alert
alert_status
Type: String
Current state of the alert
alert_title
Type: String
Name of the alert
alert_transition
Type: String
ITSM Transform: (script) -> state
Alert transition state: Triggered, Warn, or Recovered
assignment_group_sys_id
Type: Reference
ITSM Transform: assignment_group
Reference Table: Group
ServiceNow sys_id for the templated handle’s assignment group
business_service_sys_id
Type: Reference
ITSM Transform: business_service
Reference Table: Service
ServiceNow sys_id for the templated handle’s business service
custom_fields
Type: String
User-configured key-value fields formatted as JSON-convertible string
datadog_tags
Type: String
Datadog tags from the alerting monitor
description
Type: String
ITSM Transform: description
ITOM Transform: description
Summary description of the monitor alert
event_details
Type: String
ITSM Transform: work_notes
Event details with formatted, clickable links to Datadog
event_id
Type: String
Datadog ID of the event
event_link
Type: String
Link to the event created from the monitor alert
event_msg
Type: String
Message from the event
event_title
Type: String
ITSM Transform: short_description
Title of the event
event_type
Type: String
ITOM Transform: type
Type of event
hostname
Type: String
ITSM Transform: cmdb_ci
ITOM Transform: node
Host of the affected monitor
impact
Type: Integer
ITSM Transform: impact
Impact value based on user-defined mapping of monitor priority
logs_sample
Type: String
Sample of relevant logs
monitor_priority
Type: Integer
ITOM Transform: severity
Priority of the alerting monitor as an integer
org_name
Type: String
Name of the alerting monitor’s organization
sys_created_by
Type: String
ITSM Transform: caller_id
Creator of the record (usually the configured ServiceNow API account)
ticket_state
Type: String
ITSM Transform: state, (script) -> close_code, (script) -> close_notes
ITOM Transform: (script) -> resolution_notes
State of the ServiceNow record: new or resolved
u_correlation_id
Type: String
ITSM Transform: correlation_id
ITOM Transform: message_key
Combined alert_cycle_key and aggreg_key used to coalesce records to the same target incident
urgency
Type: Integer
ITSM Transform: urgency
Urgency set from the user defined mapping on the integration tile based on monitor defined priority
user_sys_id
Type: Reference
ITSM Transform: assigned_to
Reference Table: User
sys_id from the templated handle passed in for user.

Configure Datadog Case Management

Case Management integration is not supported in the site.

Send cases from Datadog to either the Datadog Cases ITOM or ITSM table in ServiceNow. ServiceNow stores incoming records and uses the installed update set to transform the records in the Event or Incident table. Datadog doesn’t support custom payloads for these tables, or updates to the Events table.

The user configuring the settings in ServiceNow must have both the x_datad_datadog.user and admin roles.
  1. In Datadog, go to the ServiceNow integration settings page.
  2. Go to the Configure tab, then the ITOM/ITSM tab, then the Case Management tab.
  3. Under Sync ServiceNow with Case Management, open the settings for your ServiceNow instance.
  4. Beside Case Table, choose to send cases to either Datadog Cases ITOM or Datadog Cases ITSM.
  5. Navigate to the Case Management > Settings page, and expand your project. Then, set up the ServiceNow integration for that project.

Configure Datadog Incident Management

After installing the integration, in Datadog, go to the Integration Settings page. Click the ServiceNow tile to configure ServiceNow incident creation.

Sync data bidirectionally between ServiceNow and Case/Incident Management

In ServiceNow, you can sync state, impact, and urgency bidirectionally with both Case Management and Incident Management.

  1. In Datadog, follow the instructions to create a service account application key.
    Note: Datadog recommends creating this key instead of using a personal one, which risks breaking the ServiceNow sync if the user’s account is deactivated or if their permissions change.
  2. In ServiceNow, click the globe icon in the top-right corner, then make sure the Application Scope is set to ITOM/ITSM Integration for Datadog.
  3. In the top-left navigation menu, click All.
  4. Type ITOM/ITSM Integration for Datadog in the filter.
  5. Click the Configuration link from the filtered results, then enter the required settings:
    1. Select your Datadog Data Center.
    2. Paste in your Datadog API Key.
    3. Paste in your Service Account Application Key you created.
    4. Check the Enabled box.
  6. Click Save.
  7. (Optional) If you have ITOM/ITSM integration version 2.7.0 or newer, you can use information from correlated alerts to populate values in ServiceNow.
    The transform maps for Datadog Cases ITOM and ITSM tables contain an example transform script that runs onBefore. By default, the script is commented out, but you can enable it by uncommenting it and modifying it to fit your use case.

This section describes the fields that are synced between Incident Management and ServiceNow:

Incident ManagementServiceNow Cases TableServiceNow IncidentSync Status
TitleTitle - StringShort DescriptionOne way sync from Datadog -> ServiceNow
What HappenedDescription - StringDescriptionOne way sync from Datadog -> ServiceNow
StateState - StringStateBi-directionally synced
DD Incident URLIncident URL - StringWork NotesOne way sync from Datadog -> ServiceNow
SeverityIncident Urgency (int)UrgencyBi-directionally synced
SeverityIncident Impact (int)ImpactBi-directionally synced
Datadog Monitor StateServiceNow Incident State
AlertIn Progress
WarnIn Progress
OKResolved
Completed (optional, configured in settings)Resolved
Datadog Incident Severity*ServiceNow UrgencyServiceNow ImpactServiceNow Priority
SEV-1111 - Critical
SEV-2122 - High
SEV-2212 - High
SEV-3133 - Moderate
SEV-3223 - Moderate
SEV-3313 - Moderate
SEV-4234 - Low
SEV-4324 - Low
SEV-5 (Minor)335 - Planning
Unknown335 - Planning

Note: If Start at SEV-0 is enabled in Incident Management settings, the values in ServiceNow Urgency, ServiceNow Impact, and ServiceNow Priority will all stay the same, but the Datadog Incident Severity shifts down by 1. For example, in the first row of this table, the Datadog Incident Severity would be 0, but the rest of the values in the rest of the row would stay the same.

Customize data with transform maps

The ServiceNow integration writes from Datadog to interim tables, which transform to records in ServiceNow. For any customizations (for example, custom field mappings), you can extend the transform maps to specify what fields you want to map to from Datadog to ServiceNow.

Additional configuration options

To prevent the import set table x_datad_datadog_import_host from accumulating too many rows, an auto-flush rule has been added to the Table Cleaner tool to keep only the last 24 hours of data. This configuration setting can be changed as needed by navigating to sys_auto_flush_list.do in the filter navigator and going into the rule for the x_datad_datadog_import_host table. The Age in seconds field can be updated accordingly.

To create a custom field mapping in ServiceNow:

  1. Click one of the tables (for example, Datadog Monitors ITSM Tables), and scroll to the bottom of the record to see the link for the associated transform map.

  2. Click on the name of the transform map to view the record:

    ServiceNow Table Transform Map showing the Datadog Incident Transform that maps the Datadog Incident Table to the Incident table.
    At the top are two important fields on the Transform record: Source table and Target table:
    Datadog Incident Transform map in ServiceNow showing the source table Datadog Incident Table mapped to the target table Incident [incident]
  3. Click New:

    Field Maps tab in ServiceNow showing source and target field mappings for the Datadog Incident Transform. A pink arrow points to the New button used to add a new field map.
  4. Select the source and target fields for one to one mappings:

    ServiceNow Field Map configuration showing the source field PRIORITY mapped to the target field Severity in the Datadog Incident Transform map
    Or check the Use source script box and define transformations:
    ServiceNow Field Map script in the Datadog Incident Transform showing a source script that maps source.priority values to numerical severity levels for the Priority field in the Incident table.

To map custom fields in the integration tile, you can use the following script for either the Datadog Monitors ITOM and Datadog Monitors ITSM Transform maps. In this example, the field my_field is defined as a custom field in the integration tile:

answer = (function transformEntry(source)
{
    var additional_info = JSON.parse(source.additional_info);
    return additional_info.my_field;
})(source);

Notes:

  • The source is the import set table you selected (in this example, Datadog Monitors ITSM Tables) and the target is your actual incident table (or event table) where events are stored.

  • The field mappings are at the bottom of the record. Some basic mappings are included. This is where you select the fields to include, define the format, and select the target fields in your ServiceNow instance.

Troubleshooting

If you get an error message in your Datadog integration tile, or an Error while trying to post to your ServiceNow instance notification:

  • Verify only the subdomain was used when entering your instance name.

  • Verify the user you created has the required permissions.

  • Verify the username and password are correct.

If the integration is configured and an alert triggered, but no ticket is created:

  • Confirm that the interim table is populated. If so, the issue is with mappings and transformations. You can debug your mappings and scripts further by navigating to Transform Errors in ServiceNow.
  • Confirm that you’re working with the interim table you specified in the tile.

The ServiceNow user needs rest_service and x_datad_datadog.user roles so that it can access the import tables. If you’re using the legacy way of sending notifications directly to either the Incident table or Event table, you need the permissions itil and evt_mgmt_integration.

If you’re seeing updates from Datadog Case Management to ServiceNow, but not seeing updates from ServiceNow to Datadog, this is expected behavior for ServiceNow ITOM. Bidirectional syncing with Case Management is only supported for ServiceNow ITSM.

If a monitor is reopening the same incident instead of creating a new one for each warning, ensure it is not set as a simple alert. Convert the monitor to a multi-alert by grouping it using a tag in the metric. This way, each alert will trigger a separate incident.

Need additional help? Contact Datadog support.

Further Reading

Documentation, liens et articles supplémentaires utiles: