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

# ServiceNow Change

> Send EvalGate's pass or block decision to a ServiceNow change request: a signed attachment, a work note, and a hold on block. Experimental.

# ServiceNow Change

EvalGate can send its gate and release decisions to a ServiceNow change
request. Each decision becomes a signed file on the change and a work note a
reviewer can read without leaving ServiceNow. When EvalGate blocks, the change
goes on hold until a later decision passes.

> [!NOTE]
>
> ServiceNow Change delivery is **Experimental**. It has been proved end to end
> against a ServiceNow developer instance; it has not yet been qualified against
> a customer production instance. See [feature status](/docs/platform/feature-status.md).

## What gets sent

| Decision | What happens on the change request |
| - | - |
| Gate decision on a commit (an evaluation-loop workflow) | Signed decision attached, work note written |
| Release decision on an AI release | Signed decision attached, work note written |
| **Block** (with "hold on block" on) | The change is put on hold with a reason starting `EvalGate:` |
| A later **pass** (with "hold on block" on) | EvalGate removes its own hold. A hold someone else placed is left alone |

The attachment, `evalgate-decision-<decision id>.json`, contains the decision
body, its SHA-256 digest and an HMAC-SHA256 signature made with your
organization's EvalGate report signing key. When a release was approved in
the same workflow before this commit, the work note's second line is the
bottom line against it ("Against the last approved release: …"), the same
sentence the release panel shows. The same decision is also sent to
signed webhooks subscribed to `gate.decision.recorded` or
`release.decision.recorded`.

## Set up ServiceNow (one time)

You need an administrator on the ServiceNow instance.

1. **Allow client credentials.** In **System Properties**, set
   `glide.oauth.inbound.client.credential.grant_type.enabled` to `true`
   (create it as a true/false property if it does not exist).
2. **Create an integration user**, for example `evalgate.integration`, with
   **Web service access only** ticked and only the `sn_change_write` role.
3. **Create an OAuth client** in **System OAuth → Application Registry →
   Create an OAuth API endpoint for external clients**. Set its **OAuth
   Application User** to the integration user and its **Default Grant type** to
   **Client Credentials**. Copy the **Client ID** and **Client Secret**.

ServiceNow restricts password (basic) authentication on new instances, so
EvalGate uses OAuth only.

## Connect EvalGate

1. In EvalGate, open **Settings → Webhooks** and find **ServiceNow Change**.
2. Enter the instance address (`https://yourcompany.service-now.com`), the
   Client ID and the Client Secret. Optionally enter a test change number.
3. Choose **Connect ServiceNow**. EvalGate signs in, and reads the test change
   when given, before it stores anything.

The client secret is stored with the organization's provider credential
keyring, the same encrypted, rotatable and erasable storage as other provider
credentials. It is never shown again. Model calls and trace pulls never read
it.

## Link a change request

Under **Linked change requests**, choose **Workflow** or **AI release**, paste
the workflow or release page address (or its ID), enter the change number such
as `CHG0030001`, and choose **Link**. EvalGate checks that the integration user
can read the change first.

From then on, every new decision for that workflow or release is delivered to
the change. **Recent deliveries** shows each delivery's status and whether the
change was held or released.

## How delivery works

* The decision is written to EvalGate's durable outbox in the same database
  transaction as the decision itself, so it is never lost and never sent for a
  decision that did not save.
* Each decision is delivered once per linked change. A retry after a partial
  failure reuses the attachment it already added.
* Failed attempts are retried with backoff. The error is shown on the delivery.
* If an older decision arrives after a newer one (for example after a retry),
  it is still attached, but only the newest decision for that change, delivered
  or still retrying, changes the hold. Deliveries to one change run one at a time.
* If the change is already on hold for another reason, a block leaves that hold
  and its reason untouched, so a later pass never releases it.
* Only ServiceNow-hosted instances (`*.service-now.com`,
  `*.servicenowservices.com`) are accepted. Requests never follow redirects.

## API

The same operations are available to administrators with the `admin:workspace`
scope:

| Operation | Endpoint |
| - | - |
| Connection status | `GET /api/org/servicenow` |
| Connect or replace the client | `POST /api/org/servicenow` |
| Disconnect | `DELETE /api/org/servicenow` |
| List links | `GET /api/org/decision-links` |
| Link a workflow or release | `POST /api/org/decision-links` |
| Remove a link | `DELETE /api/org/decision-links/{linkId}` |
| Delivery history | `GET /api/org/decision-deliveries` |

See the [API reference](/docs/api/overview.md) for request and response shapes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.