# ServiceNow Integration

[<mark style="color:blue;">ServiceNow</mark>](https://www.servicenow.com/) transforms your business with digital IT workflows by modernizing your operations to optimize productivity, cost, and resilience with a single platform for IT.

Route detailed ticket alerts from ServiceNow to the right users in Squadcast.

### How to integrate ServiceNow with Squadcast

#### In Squadcast: Using ServiceNow as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **ServiceNow.** Copy the displayed **Webhook URL** to [configure](#in-servicenow-create-a-squadcast-webhook) it within **ServiceNow**. Finish by clicking **Add Alert Source** -> **Done.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-196450fcaa3da790ef9d94a809e64850ebd907d0%2FServiceNow.png?alt=media\&token=5c707058-b757-40cf-9f0e-334b81f6a889)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

#### In ServiceNow: Create a Squadcast Webhook

**(1)** Download the [servicenow.js](https://github.com/SquadcastHub/squadcast-servicenow-integration/blob/master/servicenow.js) file

**(2)** Navigate to the filter box and search for **Business Rules**. Click on **System Definition > Business Rules**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4d53a650c343e964700b90d94ccbcd21581b2749%2Fservicenow_2.png?alt=media\&token=8a0f5199-84b6-47f0-b8c1-e555d1a25d40)

**(3)** Click on **New**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-f5a5b92e646f7e4e8369a518754d5ab3142e3aec%2Fservicenow_3.png?alt=media\&token=1f0c201b-4bfa-4db6-8b31-563941acdf7f)

**(4)** Provide any suitable **Name**, select **Incident** in the drop-down and check the **Advanced** option

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-198715829ad794659bc390962724376dd6ed3b47%2Fservicenow_4.png?alt=media\&token=c173fa7a-4884-4683-8b41-732c6536d6e7)

**(5)** Navigate to **when to run** and fill the form as shown in the screenshot below

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-06214d14e70086cbcee46acf5e8c67d102eb9d37%2Fservicenow_5.png?alt=media\&token=231e1b5f-7d59-414f-9ff2-416f81b4737f)

**(6)** Paste the previously downloaded and copied snippet into the **Script** text box

**(7)** Replace <**Squadcast Webhook URL**> with the previously copied Webhook URL and click on **Submit**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-29ad0c88e410aee465e5715351de46dadeedc19e%2Fservicenow_6.png?alt=media\&token=7171497b-8c6b-4881-a7ea-538002dddcf5)

{% hint style="info" %}
**Important:**

Understanding how the integration works:

* Trigger a new incident:

For `state: 1` in the ServiceNow ticket payload, an incident is triggered in Squadcast.

* Resolve an existing incident:

For `state: 6`, `state: 7` and `state: 8`, incidents are resolved in Squadcast (pertaining to auto-resolution of an existing, *open* incident)

Please ensure that the right `status` is being sent within the payload for the tickets into Squadcast. If values other than the ones mentioned above are sent for `status`, the integration will not work as expected.

In case of any queries, please feel free to reach out to our [Support team](mailto:support@squadcast.com).
{% endhint %}

That is it, you are now good to go! Whenever a ticket is created with the `New` status, an incident will be created in Squadcast for it. When the ticket is moved to `Resolved`, `Closed` or `Deleted` status in ServiceNow, the corresponding incident will automatically get resolved in Squadcast as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
