# ServiceNow

ServiceNow is a cloud-based SaaS (Software-as-a-Service) platform that automates organizational processes and delivers a consistent, consumer-like experience. It is a comprehensive development environment in which you can build, test and implement applications that provide automated workflows for challenges such as case management, operations management and services management.&#x20;

{% hint style="info" %}
The detailed user guide can be found at <https://docs.servicenow.com/en-US/bundle/sandiego-platform-user-interface/page/administer/navigation-and-ui/concept/c_SystemUserGuide.html>
{% endhint %}

## Prerequisites

To successfully integrate ServiceNow with ReleaseOwl, ensure you have the following:

* **ServiceNow**: A functional ServiceNow instance with the necessary permissions to access and configure Application Registry and OAuth settings.
* **ReleaseOwl Dashboard**: Access to the ReleaseOwl platform with appropriate administrative rights to manage credentials and integrations.

## Registering ServiceNow

### Step 1: Access Credential Manager

1. In Administration, go to Credential Manager.
2. On the displayed page, click Register Credential.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FGwzjMncHusffeeciJcgL%2Fimage.png?alt=media&#x26;token=f4ccdd57-da1a-4c29-86bd-08048bc97680" alt=""><figcaption></figcaption></figure>

### Step 2: Fill in Credential Details

To set up your credentials in ReleaseOwl, complete the following fields:

1. **Credential Name**:\
   Enter a descriptive name for the credential, which will help you identify it later in ReleaseOwl.
2. **Credential Type**:\
   Select **ServiceNow** from the list of available credential types.
3. **Scope** – Select the scope of the credential:
   * **Global** – Visible to all users.
   * **Private** – Visible only to the user who created it.
4. **Authentication Type**:\
   Choose one of the following authentication methods:
   * **OAuth2**: Use this option for token-based authentication.
   * **Basic Authentication**: Use this option for username and password-based access.
5. **Instance URL**:\
   Enter your ServiceNow hosting URL (e.g., `https://<instance-name>.service-now.com`).

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F5g5LUgdOMuGo2jZuweDA%2Fimage.png?alt=media&#x26;token=e6c8a7f8-d3a6-4c4b-9149-5f6dd94f1801" alt=""><figcaption></figcaption></figure>

### Step 3: OAuth2 Authentication (For Client ID and Client Secret):

1. Log in to the **ServiceNow** website.
2. Go to **ALL** and search for **Application Registry.**
3. Click on **Application Registry.**

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FmdnW0zMQtzC74qKosMa3%2Fimage.png?alt=media&#x26;token=14a58c6d-6dde-4379-8694-27f502dad0eb" alt=""><figcaption></figcaption></figure>

4. Click the **New** button.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FKEYJHV0RWxBtzqee11kz%2Fimage.png?alt=media&#x26;token=c1c8d0a1-e49f-4f79-902a-0288136cd463" alt=""><figcaption></figcaption></figure>

5. Select **Create an OAuth API endpoint for external clients**.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FDtGSj69UWDZNi2GOMxZZ%2Fimage.png?alt=media&#x26;token=57883bd2-b3b5-4dcc-b80b-2746bf0a218c" alt=""><figcaption></figcaption></figure>

6. ServiceNow will generate a **Client ID** and **Client Secret** automatically.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FSaq3kVH11acmqewzjT0j%2Fimage.png?alt=media&#x26;token=915d165f-86b1-4a23-bad9-3c99c20907f6" alt=""><figcaption></figcaption></figure>

7. Copy these credentials and paste them into the appropriate fields in the **Register Credential** form in ReleaseOwl under OAuth2 Authentication.
8. Click the **Save** button.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FZ0vJtKcmXu2Vs2C2Ca8a%2Fimage.png?alt=media&#x26;token=8e96935a-a6dd-42c3-836d-37ba8de0b8d9" alt=""><figcaption></figcaption></figure>

9. Click on **Generate Token.** A popup screen will appear prompting you to enter a username and password.
10. Enter your **ServiceNow** username and password.
11. Click the **Generate** button.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FYkEJQa1qgkKgFMcAHbvU%2Fimage.png?alt=media&#x26;token=324544be-0417-4842-b3f6-052bcb6b1b1b" alt=""><figcaption></figcaption></figure>

12. The generated token will be available in the **Manage Tokens** section under **ALL** in the ServiceNow website.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FOTlXUUnOmfoE97DNkT2K%2Fimage.png?alt=media&#x26;token=0159a5ca-d258-40af-9f92-54c612ef5f33" alt=""><figcaption></figcaption></figure>

### Step4: Configure Basic Authentication (For Basic Authentication)

To perform **Basic Authentication**, follow the steps below:

1. In Administration, go to **Credential Manager**.
2. On the displayed page, click **Register Credential**.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FGwzjMncHusffeeciJcgL%2Fimage.png?alt=media&#x26;token=f4ccdd57-da1a-4c29-86bd-08048bc97680" alt=""><figcaption></figcaption></figure>

3. Fill in the credential details as shown in the table below:

| **Field**               | **Description**                                                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Credential Name**     | Enter a name of your choice.                                                                                                    |
| **Credential Type**     | Select **ServiceNow**                                                                                                           |
| **Scope**               | Select the scope of the credential:- **Global** – Visible to all users.- **Private** – Visible only to the user who created it. |
| **Authentication Type** | Choose **Basic**.                                                                                                               |
| **Username**            | Enter **ServiceNow username**.                                                                                                  |
| **Password**            | Enter **ServiceNow password**.                                                                                                  |
| **Instance URL**        | Enter your ServiceNow hosting URL (e.g., `https://<instance-name>.service-now.com`).                                            |

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F7tPzAOrarVLq6TDYAXP9%2Fimage.png?alt=media&#x26;token=b32e09c2-a7ee-4dd8-b248-433411c149ac" alt=""><figcaption></figcaption></figure>

## Integrating User Stories from ServiceNow to ReleaseOwl

#### &#x20;1. Open Project Settings

* Navigate to the top-right corner of the ReleaseOwl environment and click on Project Settings.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FT755wB2novtj7NUHWQmQ%2Fimage.png?alt=media&#x26;token=eaca86b2-180f-4498-b842-5fa37f15e888" alt=""><figcaption></figcaption></figure>

#### 2. Go to ALM Integrations

1. In Project Settings, go to the ALM Integrations section and click on the +Add button.
2. Fill in the necessary fields:

* Name: Enter a name of your choice.
* External System: Select ServiceNow for integration.
* Credential: The registered credential will be auto-populated.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FhBzSfU8bcFDieuLx9N6s%2Fimage.png?alt=media&#x26;token=9fdbd306-140d-418d-b0f1-af83ce70f104" alt=""><figcaption></figcaption></figure>

#### 3. Access Filters Option

* Under the Host URL, you will find options for Assignment Group or Filters.

#### 4. Webhook URL & Save

* The Webhook URL is generated automatically. Click on the Save button to confirm the integration settings.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FlDmxvIas5NKYRtRVIqQG%2Fimage.png?alt=media&#x26;token=7c06bd74-2997-4791-b2ef-42d855a2e664" alt=""><figcaption></figcaption></figure>

### Assignment Group Option

* If you choose the Assignment Group option, you will see a section where you can select an Assignment Group from the available External Projects in ServiceNow.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FjVEpqTf5nPouHIBaR2x7%2Fimage.png?alt=media&#x26;token=bbe2d8fc-1354-47ed-acd2-c3c76347c074" alt=""><figcaption></figcaption></figure>

* These groups correspond to different teams or categories in ServiceNow, such as:
* Incident Management
* Application Development
* Problem Analyzers, etc.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FSIJsAzo7G0t0zSCR7Dzm%2Fimage.png?alt=media&#x26;token=a70446b5-2e54-48fa-99bb-7912e3859d49" alt=""><figcaption></figcaption></figure>

### Syncing User Stories

Select the project. Any changes made in ServiceNow will be reflected in the User Stories when you click on Sync User Stories

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F7FYwXfH4b5oAUapct7aD%2Fimage.png?alt=media&#x26;token=316ef446-7303-4318-9b36-e545a7711af5" alt=""><figcaption></figcaption></figure>

### Filters Option

* If you choose the Filters option, you will access the Filters Section.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F9PWM8z0GUu26dVBzOdtZ%2Fimage.png?alt=media&#x26;token=7370ca76-e5df-4987-9c5a-40b544fa9cb9" alt=""><figcaption></figcaption></figure>

### Add New Filters

* Click on the +ADD button.
* A pop-up window will appear, displaying three filter types:
* Task
* Incident
* Change Request

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F6B83RXOqWzVvWGMAGdr3%2Fimage.png?alt=media&#x26;token=4590b52e-a2a0-41f1-8675-d28805c58288" alt=""><figcaption></figcaption></figure>

### Select and Add a Filter

* Choose the appropriate filter type based on your requirements.
* Click Add to apply the selected filter.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FAKwxAgOm6BObDL7R1MBP%2Fimage.png?alt=media&#x26;token=f465cdf7-80c7-41af-95c0-fbf0cf8ec388" alt=""><figcaption></figcaption></figure>

### Sync User Stories with Applied Filters

* Once the filters are added, click on Sync User Stories to fetch the relevant user stories from ServiceNow based on the selected filters.
* Any updates made in ServiceNow will now reflect in the synced User Stories within ReleaseOwl.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FSgXk0rVpNn69BVC5pZcF%2Fimage.png?alt=media&#x26;token=91e8b9a3-5534-424f-9056-6814d55e29a9" alt=""><figcaption></figcaption></figure>

## Configure Webhook URL in ServiceNow

Follow the steps below to configure a webhook in ServiceNow:&#x20;

1. Log in to your **ServiceNow** account.
2. In the left navigation pane, select **All**.
3. Type **Business Rules** in the filter box and open it.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FWuPlYRqdiVvr3qUdW4Em%2Fimage.png?alt=media&#x26;token=5fc7c1f6-4cc4-4208-aaf9-cc8a983496db" alt=""><figcaption></figcaption></figure>

4. Click the **New** button on the right-hand side.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FCMsKuF6q1h5ut6qCkUx0%2Fimage.png?alt=media&#x26;token=440a9bdc-1aaf-4d65-a103-682f9bc4c5e9" alt=""><figcaption></figcaption></figure>

5. Enter a **Name** for your record.
6. In the **Table** field, select the table you want to trigger the webhook from (for example, **Incident**, **Change Request , Task** etc.).
7. Check the **Active** and **Advanced** options.
8. In the **When to run** section:

* From the **When** drop-down, select **After**.
* Select **Insert** and **Update** so the webhook triggers on both record creation and updates.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2F7RZ09WG9mUfEz1eP3Hdc%2Fimage.png?alt=media&#x26;token=9aa5a0cc-740d-443c-984e-574d1c4e7816" alt=""><figcaption></figcaption></figure>

8. In the **Advanced** section, paste the following script:

```javascript
(function executeRule(current, previous /*null when async*/) {
    var request = new sn_ws.RESTMessageV2();
    request.setEndpoint("<copy the Webhook URL from the PMS integration tab in ReleaseOwl Project settings>");
    request.setHttpMethod('POST');
    //request.setBasicAuth(user,password);
    request.setRequestHeader("Accept", "application/json");
    request.setRequestHeader("Content-Type", "application/json");
    
    request.setRequestBody(
        JSON.stringify({
            "sys_id": current.sys_id.toString(),
            "product": current.product.toString()
        })
    );
    
    var response = request.execute();
    gs.log(response.getBody());
})(current, previous);
```

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FvK30GRCxw80hLpQqIUCq%2Fimage.png?alt=media&#x26;token=d5caf24c-72f5-4918-ba04-0871862e34ef" alt=""><figcaption></figcaption></figure>

#### Note

* Replace the placeholder `<copy the Webhook URL…>` in the script with the actual **Webhook URL** generated in **ReleaseOwl** under: **Project Settings → PMS Integration tab**.
* The webhook URL in ReleaseOwl follows this pattern:

  ```
  https://na3.releaseowl.com/ratesaptms/webhook/tenant/{tenant}/project/{projectId}/{tableName}/sync?secretKey={secretKey}
  ```
* **{tableName}** must match the table selected in the Business Rule Record (e.g., `incident`, `task`, `change_request,`). This means the table name is not only used to determine which records trigger the webhook—it also appears explicitly in the webhook URL path.

<figure><img src="https://1890383800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDWyxe6hm5vqosFaByVgs%2Fuploads%2FW6sc4fQXPgKAsuWoi4IG%2Fimage.png?alt=media&#x26;token=b26d135e-a958-457c-ba8b-3a3dde5f6a8e" alt=""><figcaption></figcaption></figure>
