> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rootly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the Rootly ServiceNow integration via OAuth and configure Business Rule webhooks for bidirectional incident sync, field mapping, and ticket automation.

## Introduction

The ServiceNow integration connects Rootly with your ServiceNow instance bidirectionally. Rootly can create and update ServiceNow incidents through workflow actions, and ServiceNow can send incident events to Rootly as alerts using Business Rules.

With the ServiceNow integration, you can:

* Automatically create ServiceNow incidents from Rootly incidents
* Update ServiceNow incident priority, state, and custom fields as incidents evolve
* Receive ServiceNow incident events as Rootly alerts to trigger on-call paging
* Sync ServiceNow CMDB business applications to Rootly services

## Before You Begin

Before setting up the integration, make sure you have:

* A Rootly account with admin permission to manage integrations
* A ServiceNow instance with admin access
* Permission to create OAuth Application Registry entries in ServiceNow

<Callout icon="user-shield" color="#DBEAFE">
  We recommend installing with a dedicated ServiceNow service account so the integration does not break if an individual user leaves your organization.
</Callout>

## Installation

### Part 1: Connect Rootly to ServiceNow (OAuth)

<Steps>
  <Step title="Open the ServiceNow integration in Rootly" icon="plug">
    Log into Rootly as an Admin and navigate to **Configurations > Integrations > ServiceNow**. Click **Setup**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-setup-modal.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=45848eae128419626a34d4088d496281" alt="CleanShot 2025-05-13 at 11.16.39.png" width="877" height="420" data-path="images/integrations/servicenow/servicenow-setup-modal.webp" />
  </Step>

  <Step title="Create an OAuth Application in ServiceNow" icon="key">
    Log into your ServiceNow instance as an Admin and navigate to **System OAuth > Application Registry**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-system-oauth-menu.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=293375294574916c4891b20d965b71ae" alt="CleanShot 2025-05-13 at 11.19.50.png" width="594" height="439" data-path="images/integrations/servicenow/servicenow-system-oauth-menu.webp" />

    Click **New**, then select **Create an OAuth API endpoint for external clients**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-oauth-endpoint-selection.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=cb441f2e8b2a1a58eecac445c47730f4" alt="CleanShot 2025-05-13 at 11.25.24.png" width="1038" height="279" data-path="images/integrations/servicenow/servicenow-oauth-endpoint-selection.webp" />

    Fill in the following fields and click **Submit**:

    | ServiceNow Field | Value                                          |
    | ---------------- | ---------------------------------------------- |
    | `Name`           | `Rootly`                                       |
    | `Redirect URL`   | `https://rootly.com/auth/service_now/callback` |

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-oauth-application-form.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=ac363368ad072857c031e5d9e09da5d1" alt="CleanShot 2025-05-13 at 11.31.13.png" width="1582" height="610" data-path="images/integrations/servicenow/servicenow-oauth-application-form.webp" />
  </Step>

  <Step title="Copy credentials from ServiceNow to Rootly" icon="copy">
    Open the application you just created in ServiceNow and copy the **Client ID** and **Client Secret**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-client-credentials.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=577805cc7885234274760d74b87ab1af" alt="CleanShot 2025-05-13 at 11.35.47.png" width="1266" height="671" data-path="images/integrations/servicenow/servicenow-client-credentials.webp" />

    <Callout icon="triangle-exclamation" color="#FEF3C7">
      When copying the **Client Secret**, you may need to unmask it by clicking the lock icon. Masked values sometimes do not copy correctly in ServiceNow.
    </Callout>

    Paste the Client ID, Client Secret, and your ServiceNow instance URL into the Rootly setup modal and click **Connect**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/rootly-servicenow-connection-form.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=e2653262da5998695443d59113b1423e" alt="CleanShot 2025-05-13 at 11.38.08.png" width="878" height="426" data-path="images/integrations/servicenow/rootly-servicenow-connection-form.webp" />
  </Step>

  <Step title="Authorize Rootly in ServiceNow" icon="circle-check">
    You will be redirected to ServiceNow to authorize the connection. Click **Allow**.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-oauth-authorization.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=70e8ce06b088eaa34a88c7cb3fba1283" alt="CleanShot 2025-05-13 at 11.43.07.png" width="906" height="475" data-path="images/integrations/servicenow/servicenow-oauth-authorization.webp" />

    <Callout icon="circle-check" color="#DCFCE7">
      After authorization, the **Create a ServiceNow Incident** and **Update a ServiceNow Incident** workflow actions are available in your Genius workflows.
    </Callout>
  </Step>
</Steps>

### Part 2: Receive ServiceNow Events in Rootly (Webhooks)

To receive ServiceNow incident events as Rootly alerts, configure a Business Rule in ServiceNow to send events to Rootly's webhook endpoint.

<Steps>
  <Step title="Get your webhook URL and secret from Rootly" icon="link">
    In Rootly, open the ServiceNow integration settings. Copy the **Webhook URL** and **Secret** values shown on the integration page.
  </Step>

  <Step title="Create a Business Rule in ServiceNow" icon="code">
    In ServiceNow, navigate to **System Definition > Business Rules**.

    <Callout icon="info" color="#DBEAFE">
      There are multiple Business Rules pages in ServiceNow. Make sure you select the one under **System Definition**.
    </Callout>

    Click **New** and fill in:

    | Field      | Value                                              |
    | ---------- | -------------------------------------------------- |
    | `Name`     | Any descriptive name (e.g. `Send to Rootly`)       |
    | `Table`    | `Incident [incident]`                              |
    | `Advanced` | Check this                                         |
    | `When`     | `After`                                            |
    | `Insert`   | Check to receive events when incidents are created |
    | `Update`   | Check to receive events when incidents are updated |
    | `Delete`   | Check to receive events when incidents are deleted |

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-business-rule-advanced-tab.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=794f604c4e157b03891e9c1c7a640551" alt="CleanShot 2025-05-13 at 12.08.46.png" width="974" height="824" data-path="images/integrations/servicenow/servicenow-business-rule-advanced-tab.webp" />

    Navigate to the **Advanced** tab and replace the script with the following:

    ```js theme={null}
    (function executeRule(current, previous /*null when async*/ ) {
        try {
            var r = new sn_ws.RESTMessageV2();
            r.setEndpoint("<insert webhook public URL>");
            r.setHttpMethod("post");
            r.setRequestHeader("secret", "<secret>");

            var usr = new GlideRecord('sys_user');
            usr.get('sys_id', current.getValue("caller_id"));
            var reported_by_email = usr.getValue('email');

            var number = current.getValue("number");
            var opened_at = current.getValue("opened_at");
            var impact = current.getValue("impact");
            var urgency = current.getValue("urgency");
            var short_description = current.getValue("short_description");
            var description = current.getValue("description");
            var category = current.getValue("category");
            var priority = current.getValue("priority");
            var sys_id = current.getValue("sys_id");
            var subcategory = current.getValue("subcategory");
            var state = current.getValue("state");

            var obj = {
                "number": number,
                "reported_by_email": reported_by_email,
                "opened_at": opened_at,
                "impact": impact,
                "urgency": urgency,
                "short_description": short_description,
                "description": description,
                "category": category,
                "priority": priority,
                "sys_id": sys_id,
                "subcategory": subcategory,
                "state": state
            };

            var body = JSON.stringify(obj);
            r.setRequestBody(body);

            var response = r.execute();
            var httpStatus = response.getStatusCode();
        } catch (ex) {
            var message = ex.message;
            gs.error("Error message: " + message);
        }

        gs.info("Webhook target HTTP status response: " + httpStatus);

    })(current, previous);
    ```

    Replace `<insert webhook public URL>` and `<secret>` with the values from the Rootly ServiceNow integration page.

    <img src="https://mintcdn.com/rootly/6qP0tS1GNk4jbxrs/images/integrations/servicenow/servicenow-webhook-configuration.webp?fit=max&auto=format&n=6qP0tS1GNk4jbxrs&q=85&s=2c0ed80a67d3a18ceeb5477b0e0c40a7" alt="CleanShot 2025-05-13 at 12.13.02.png" width="880" height="801" data-path="images/integrations/servicenow/servicenow-webhook-configuration.webp" />

    Click **Submit**.
  </Step>
</Steps>

### How Alerts Are Mapped

Each ServiceNow event received creates a Rootly alert with the following fields:

| Rootly Alert Field | ServiceNow Source                                      |
| ------------------ | ------------------------------------------------------ |
| Summary            | `short_description`, then `description`, then `number` |
| External ID        | `sys_id`                                               |
| External URL       | `url` (if provided in payload)                         |

Alert labels:

| Label         | ServiceNow Field |
| ------------- | ---------------- |
| `id`          | `sys_id`         |
| `number`      | `number`         |
| `impact`      | `impact`         |
| `urgency`     | `urgency`        |
| `category`    | `category`       |
| `subcategory` | `subcategory`    |
| `state`       | `state`          |

## Using ServiceNow as an Alert Source

If your org uses Rootly On-Call, ServiceNow alerts can be used to page on-call users. Once the Business Rule is configured, alerts from ServiceNow will appear in your Rootly alert feed and can trigger on-call notifications through alert workflows.

<iframe width="640" height="360" src="https://www.loom.com/embed/c129a02a6c0c409987b873f551c6f09c?sid=c4b29bbb-50d9-4063-a2c2-ca5f02c89776" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen />

## Uninstall

To remove the ServiceNow integration, navigate to **Configuration > Integrations > ServiceNow > Delete**.
