# ServiceNow

*📋 Setting up automated task creation in ServiceNow*

### Introduction <a href="#introduction" id="introduction"></a>

This one-time setup *per workspace* allows everyone in your Aikido organization to create issues directly in ServiceNow.

Following use cases are supported:

* **Automated Ticket Creation**: Automatically create and push tickets to ServiceNow for seamless tracking of security issues.
* **Manual Ticket Addition**: Manually add security issue tickets to ServiceNow, ensuring targeted attention for critical vulnerabilities.

{% hint style="info" %}
Aikido currently pushes tickets to the **Incident** table in ServiceNow. Support for additional tables can be requested via Support.
{% endhint %}

### Prerequisites: Register an OAuth App in ServiceNow

Before connecting Aikido, you'll need to register an OAuth application in your ServiceNow instance to generate a **Client ID** and **Client Secret**.

{% stepper %}
{% step %}
**Activate the OAuth 2.0 plugin**

Log in to your ServiceNow instance and activate the OAuth 2.0 plugin if it isn't already.
{% endstep %}

{% step %}
**Enable OAuth system property**

In the `sys_properties` table, set the system property `com.snc.platform.security.oauth.is.active` to `true`.
{% endstep %}

{% step %}
**Open the Application Registry**

Navigate to **System OAuth > Application Registry**.
{% endstep %}

{% step %}
**Create a new OAuth endpoint**

Click **New**, then select **Create an OAuth API endpoint for external clients**.
{% endstep %}

{% step %}
**Configure the application**

Set the following fields:

* **Name**: A unique name (e.g. `Aikido`)
* **Client ID**: Auto-generated by ServiceNow
* **Client Secret**: Auto-generated by ServiceNow
* **Redirect URI**: `https://unify.apideck.com/vault/callback`
* **Refresh Token Lifespan**: Time in seconds the refresh token is valid
* **Access Token Lifespan**: Set to `3600`
* **Scope Restriction**: Set to **Broadly scoped**

{% hint style="info" %}
The default `Securely scoped` will cause API calls to fail.
{% endhint %}
{% endstep %}

{% step %}
**Save and copy credentials**

Click **Submit**, then reopen the record to copy the **Client ID** and **Client Secret** values.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Note: the ticket creation is linked to the user who has set up the integration. We recommend creating a dedicated 'Aikido' user inside ServiceNow with write access to the Incident table.
{% endhint %}

### Connecting the Aikido App to ServiceNow

{% stepper %}
{% step %}
**Open the integration**

Navigate to [Integration Settings](https://app.aikido.dev/settings/integrations) within the Aikido app. In the 'Task Trackers' section, select **ServiceNow**.

<figure><img src="/files/cx5AXDrhKcXeLuEZ6fNu" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Fill in your credentials**

Enter your ServiceNow **instance name**, **Client ID**, and **Client Secret**, then click **"Save"**.

{% hint style="info" %}
Your ServiceNow **instance name** is the subdomain in your admin URL (e.g. `dev394641` from `https://dev394641.servicenow.com`).
{% endhint %}

<figure><img src="/files/NpW9yhcqjRtaFAmxuUX8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Authorize the connection**

Click **"Authorize"** to grant Aikido access to your ServiceNow instance.

<figure><img src="/files/lQkXSlkfah2VpT2roU7c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Confirm**

Click **"Save"** once more to complete the setup. Aikido is now connected to ServiceNow.

<figure><img src="/files/kpYjqshO0N4e0IKfC3k8" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Options for Task Creation in ServiceNow via Aikido

There are two different options to create new tasks from Aikido into ServiceNow.

#### 1. Manual Task Creation

1. Hover over any issue in your feed and click the ***+*** in the **assign column.** Alternatively, you can click the triple dots in the last column to open up the action menu. If you have grouped issues, the triple dot action menu is available on every subissue.\
   \
   ![](/files/Qb7Y04BrqDzbbXCIcmXs)
2. Fill in the required details in the popup modal.\
   \
   ![](/files/zZvfssnnLnWEAzBQUbrF)
3. The newly created task in ServiceNow will be linked in the Aikido Issue Detail under the 'Tasks' tab.

#### 2. Automated Task Creation

{% hint style="info" %}
Aikido will automatically create tasks **every hour in bulk.** There is at the moment no option to trigger this manually.
{% endhint %}

1. Go to the [ServiceNow Integration](https://app.aikido.dev/settings/integrations/tasktracker) settings
2. Make sure to enable '**Autocreation**' by clicking the toggle to **On.**
3. Define the criteria for automatic task creation.
4. Aikido will autonomously generate ServiceNow tickets hourly until the configured daily limit of tasks is reached.

<figure><img src="/files/64D5EuIMN9uCu8TkSs7N" alt=""><figcaption></figcaption></figure>

### ServiceNow Sync

Aikido automatically syncs a couple of fields to ServiceNow:

* Severity is mapped to the 'Priority' field in ServiceNow
* Assignees are synced both ways (so updates in ServiceNow will be reflected in Aikido too)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.aikido.dev/getting-started/task-management-systems/all-supported-task-trackers/servicenow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
