> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/overview-1/approvals/service-now-approval.md).

# ServiceNow approval step

Pause pipeline execution and wait for a ServiceNow ticket to reach a specific state before continuing.

The **ServiceNow approval** step pauses a pipeline and polls a ServiceNow ticket at a configurable interval. When the ticket fields match your approval criteria, the pipeline resumes. If they match your reject criteria, the pipeline fails. If polling continues past the step timeout without a match, the step expires.

***

## What you will learn from this topic

* How to add a ServiceNow approval step to a pipeline
* How to configure the ServiceNow connector, ticket type, ticket number, and polling interval
* How to define approval and reject criteria using field conditions or a JEXL expression
* How to restrict approvals to a change window
* The complete YAML reference for `serviceNowApproval`

***

## Before you begin

* **ServiceNow connector:** You need a ServiceNow connector configured in Harness. Go to [Connect to ServiceNow](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/connectors/ticketing-systems/connect-to-service-now.md) to create one.

***

## Add the step

In Pipeline Studio, click **+** to add a step inside a stage, then search for **approval** in the step library. Select **ServiceNow Approval**.

***

## YAML

```yaml
pipeline:
  id: my-pipeline
  name: My Pipeline
  clone:
    enabled: true
    repo: my-repo
    depth: 1
  stages:
    - name: my-stage
      id: my_stage
      steps:
        - deploy:
            uses: serviceNowApproval
            with:
              connector: account.my-servicenow-connector
              ticket_type: change_request
              ticket_number: CHG0000001
              retry: 1m
              log_level: error
```

***

## Configure the step

### Required fields

The following fields are required to configure the step.

| Field                    | Description                                                                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**                 | Display name for the step in the execution view.                                                                                          |
| **ServiceNow Connector** | The ServiceNow connector that authenticates to your ServiceNow instance.                                                                  |
| **Ticket Type**          | The ServiceNow table or ticket type to poll (for example, `change_request`, `incident`, or a custom type).                                |
| **Ticket Number**        | The specific ticket number to poll (for example, `CHG0000001`). Supports runtime input `<+input>` and expressions.                        |
| **Approve Criteria**     | Conditions that must be met for the pipeline to proceed. Go to [Approval and reject criteria](#approval-and-reject-criteria) for details. |

### Optional configuration

The following fields are optional.

| Field                   | YAML key              | Default | Description                                                                                                                              |
| ----------------------- | --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **Retry Interval**      | `retry`               | `1m`    | How often Harness polls the ticket for a status change.                                                                                  |
| **Reject Criteria**     | `reject`              | None    | Conditions that cause the pipeline to fail immediately. Go to [Approval and reject criteria](#approval-and-reject-criteria) for details. |
| **Change Window Start** | `change_window_start` | None    | Earliest time the approval is valid. Accepts an ISO 8601 datetime or expression.                                                         |
| **Change Window End**   | `change_window_end`   | None    | Latest time the approval is valid. After this time the step fails even if criteria are met.                                              |
| **Log Level**           | `log_level`           | `info`  | Verbosity of step logs. Accepted values: `info`, `warn`, `error`.                                                                        |

### Advanced settings

The step supports the same advanced settings as any other step.

| Setting                   | Description                                                           |
| ------------------------- | --------------------------------------------------------------------- |
| **Timeout duration**      | Maximum time the step is allowed to run before Harness terminates it. |
| **On failure**            | What Harness does when the step fails.                                |
| **Strategy**              | Loop the step using a matrix, for, or while strategy.                 |
| **Conditional execution** | Skip the step based on a JEXL condition.                              |

Go to [Steps overview](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/overview-1.md) for details on these settings.

***

## Approval and reject criteria

`approve` is required; `reject` is optional. Both fields accept the same criteria format.

### Conditions

Click **+ Add criteria** and select **Conditions** as the condition type. Then choose your match mode and define each condition.

**Match mode**

| Value              | Behavior                                                          |
| ------------------ | ----------------------------------------------------------------- |
| **Any condition**  | Pipeline advances when at least one condition matches (OR logic). |
| **All conditions** | Pipeline advances only when every condition matches (AND logic).  |

Each condition has three fields: **Name** (the ServiceNow field name), **Operator**, and **Value**.

In YAML:

```yaml
approve:
  match-any-condition: false
  conditions:
    - state:
        eq: "Approved"
    - approval:
        eq: "approved"
```

Set `match-any-condition: true` for OR logic. Omit it or set it to `false` for AND logic.

### JEXL expression

Select **JEXL Expression** as the condition type and enter an expression that evaluates to `true` or `false`.

***

## Change window

The change window fields restrict when an approval is accepted. Harness continues polling throughout, but only accepts an approval result while the current time falls within `change_window_start` and `change_window_end`. If the window closes before the approval criteria are met, the step fails.

```yaml
with:
  connector: account.my-servicenow-connector
  ticket_type: change_request
  ticket_number: CHG0000001
  change_window_start: "2026-10-01T08:00:00Z"
  change_window_end: "2026-10-01T16:00:00Z"
```

Both fields accept expressions:

```yaml
change_window_start: <+pipeline.variables.window_start>
change_window_end: <+pipeline.variables.window_end>
```

***

## YAML reference

The following table lists all supported keys for the `serviceNowApproval` step.

| Key                           | Required | Type     | Description                                                                                          |
| ----------------------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `connector`                   | Yes      | string   | Identifier of the ServiceNow connector. Use `account.`, `org.`, or no prefix for the matching scope. |
| `ticket_type`                 | Yes      | string   | ServiceNow table or ticket type to poll.                                                             |
| `ticket_number`               | Yes      | string   | Specific ticket number to poll.                                                                      |
| `approve`                     | Yes      | object   | Criteria that advance the pipeline.                                                                  |
| `approve.match-any-condition` | No       | boolean  | `true` for OR logic; `false` or absent for AND logic.                                                |
| `approve.conditions`          | No       | list     | Field conditions. Each entry: `field-name: { operator: value }`.                                     |
| `retry`                       | No       | duration | Polling interval. Default: `1m`.                                                                     |
| `reject`                      | No       | object   | Criteria that fail the pipeline. Same structure as `approve`.                                        |
| `change_window_start`         | No       | string   | ISO 8601 datetime or expression. Approval only accepted on or after this time.                       |
| `change_window_end`           | No       | string   | ISO 8601 datetime or expression. Approval rejected after this time.                                  |
| `log_level`                   | No       | string   | Log verbosity: `info`, `warn`, `error`. Default: `info`.                                             |

Supported operators: `eq`, `not_eq`, `in`, `not_in`.

***

## Next steps

* Go to [Jira approval step](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/overview-1/approvals/jira-approval.md) for issue-based approvals.
* Go to [Steps overview](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/overview-1.md) to review all step types.
* Go to [Connect to ServiceNow](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/connectors/ticketing-systems/connect-to-service-now.md) to set up the required connector.
* Go to [On failure](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/strategy/on-failure.md) to handle step-level failures.
