> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# List rules

`GET https://api.pagerduty.com/integration-jira-cloud/accounts_mappings/{id}/rules`

List existing rules for a specific account mapping.

A Rule configures the bidirectional synchronization between Jira issues and PagerDuty incidents.

Scoped OAuth requires: `jira_cloud_rules.read`

## Authorization

- **apiKey** (apiKey) — `Authorization` header.
- **bearerAuth** (http) — HTTP bearer.

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (PagerDuty Id) | yes | The ID of the account mapping. Pattern: `^(P[0-9A-Z]{6}\|Q[0-9A-Z]{13})$`. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `offset` | integer |  | Offset to start pagination search results. Default: `0`. Minimum: 0. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |
| `limit` | integer |  | The number of results per page. Default: `25`. Minimum: 1. Maximum: 100. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |
| `total` | boolean |  | By default the `total` field in pagination responses is set to `null` to provide the fastest possible response times. Set `total` to `true` for this field to be populated. See our [Pagination Docs](https://docs.pagerduty.com/developer/pagination) for more information. Default: `false`. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |

## Response 200

A paginated list of rules.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `limit` | integer |  | Echoes limit pagination property. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |
| `more` | boolean |  | Indicates if there are additional records to return. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |
| `offset` | integer |  | Echoes limit pagination property. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |
| `rules` | array of object |  |  |
| `rules[].account_mapping` | object | yes | Account mapping to which the rule belongs. |
| `rules[].account_mapping.id` | string (PagerDuty Id) | yes | Unique identifier. Pattern: `^(P[0-9A-Z]{6}\|Q[0-9A-Z]{13})$`. |
| `rules[].account_mapping.self` | string | yes | The API URL at which the object is accessible. |
| `rules[].account_mapping.type` | string | yes | One of: `account_mapping_reference`. |
| `rules[].autocreate_jql_disabled_reason` | string \| null |  | If auto-creation using JQL is disabled, this field provides the reason for the disablement. |
| `rules[].autocreate_jql_disabled_until` | string \| null |  | The timestamp until which the auto-creation using JQL feature is disabled. |
| `rules[].config` | object | yes | Configuration for bidirectional synchronization between Jira issues and PagerDuty incidents. |
| `rules[].config.jira` | object | yes | Synchronization settings. |
| `rules[].config.jira.autocreate_jql` | string \| null |  | JQL query to automatically create PagerDuty incidents when matching Jira issues are created. Leave empty to disable this feature. |
| `rules[].config.jira.create_issue_on_incident_trigger` | boolean | yes | When enabled, automatically creates a Jira issue whenever a PagerDuty incident is triggered. Default: `false`. |
| `rules[].config.jira.custom_fields` | array \| null |  | Defines how Jira fields are populated when a Jira Issue is created from a PagerDuty Incident. |
| `rules[].config.jira.issue_type` | object | yes | Jira issue type to be created or synchronized with PagerDuty incidents. |
| `rules[].config.jira.issue_type.id` | string | yes | Unique identifier for the Jira issue type. |
| `rules[].config.jira.issue_type.name` | string | yes |  |
| `rules[].config.jira.priorities` | array \| null |  | Maps PagerDuty incident priorities to Jira issue priorities for synchronization. |
| `rules[].config.jira.project` | object | yes | Jira project where issues will be created or synchronized. |
| `rules[].config.jira.project.id` | string | yes | Unique identifier for the Jira project. |
| `rules[].config.jira.project.key` | string | yes | Unique identifier key for the Jira project. |
| `rules[].config.jira.project.name` | string | yes |  |
| `rules[].config.jira.status_mapping` | object | yes | Maps PagerDuty incident statuses to corresponding Jira issue statuses for synchronization. |
| `rules[].config.jira.status_mapping.acknowledged` | object \| null |  | Optional Jira status that maps to the PagerDuty `acknowledged` status. |
| `rules[].config.jira.status_mapping.acknowledged.id` | string \| null |  | Unique identifier for the Jira status. |
| `rules[].config.jira.status_mapping.acknowledged.name` | string \| null |  |  |
| `rules[].config.jira.status_mapping.resolved` | object \| null |  | Optional Jira status that maps to the PagerDuty `resolved` status. |
| `rules[].config.jira.status_mapping.resolved.id` | string \| null |  | Unique identifier for the Jira status. |
| `rules[].config.jira.status_mapping.resolved.name` | string \| null |  |  |
| `rules[].config.jira.status_mapping.triggered` | object | yes | Jira status that maps to the PagerDuty `triggered` status. |
| `rules[].config.jira.status_mapping.triggered.id` | string | yes | Unique identifier for the Jira status. |
| `rules[].config.jira.status_mapping.triggered.name` | string | yes |  |
| `rules[].config.jira.sync_notes_user` | object \| null |  | PagerDuty user for syncing notes and comments between Jira issues and PagerDuty incidents. If not provided, note synchronization is disabled. |
| `rules[].config.jira.sync_notes_user.email` | string | yes |  |
| `rules[].config.jira.sync_notes_user.html_url` | string \| null |  | The URL at which the user is uniquely displayed in the PagerDuty web app. |
| `rules[].config.jira.sync_notes_user.id` | string (PagerDuty Id) | yes | Unique identifier. Pattern: `^(P[0-9A-Z]{6}\|Q[0-9A-Z]{13})$`. |
| `rules[].config.jira.sync_notes_user.name` | string | yes |  |
| `rules[].config.jira.sync_notes_user.self` | string |  | The API URL at which the object is accessible. |
| `rules[].config.jira.sync_notes_user.type` | string | yes | One of: `user_reference`. |
| `rules[].config.service` | object | yes | The PagerDuty service associated with this rule. |
| `rules[].config.service.html_url` | string \| null |  | The URL at which the service is uniquely displayed in the PagerDuty web app. |
| `rules[].config.service.id` | string (PagerDuty Id) | yes | Unique identifier. Pattern: `^(P[0-9A-Z]{6}\|Q[0-9A-Z]{13})$`. |
| `rules[].config.service.self` | string |  | The API URL at which the object is accessible. |
| `rules[].config.service.summary` | string | yes | The name or summary of the PagerDuty service. |
| `rules[].config.service.type` | string | yes | One of: `service_reference`. |
| `rules[].created_at` | string | yes | The time when the rule was created. |
| `rules[].enabled` | boolean |  | Indicates if the rule is enabled. |
| `rules[].id` | string (PagerDuty Id) | yes | Unique identifier. Pattern: `^(P[0-9A-Z]{6}\|Q[0-9A-Z]{13})$`. |
| `rules[].name` | string | yes | The name of the rule. Max length: 100. Pattern: `^[^\x00-\x1F\x7F<>]+$`. |
| `rules[].updated_at` | string \| null |  | The time when the rule was last modified. |
| `total` | integer \| null |  | The total number of records matching the given query. [See our Pagination Docs for more information](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU4-pagination). |

Example: Response Example

```json
{
  "limit": 25,
  "more": false,
  "offset": 0,
  "rules": [
    {
      "account_mapping": {
        "id": "PIJ90N7",
        "self": "https://api.pagerduty.com/integration-jira-cloud/account_mappings/PIJ90N7",
        "type": "accounts_mapping_reference"
      },
      "config": {
        "jira": {
          "autocreate_jql": "priority = High",
          "create_issue_on_incident_trigger": true,
          "custom_fields": [
            {
              "source_incident_field": "incident_description",
              "target_issue_field": "description",
              "target_issue_field_name": "Description",
              "type": "attribute"
            }
          ],
          "issue_type": {
            "id": "10001",
            "name": "Incident"
          },
          "priorities": [
            {
              "jira_id": "1",
              "pagerduty_id": "PUS0KTE"
            },
            {
              "jira_id": "2",
              "pagerduty_id": "PQFCJER"
            }
          ],
          "project": {
            "id": "10100",
            "key": "ITS",
            "name": "IT Support"
          },
          "status_mapping": {
            "acknowledged": {
              "id": "2",
              "name": "In Progress"
            },
            "resolved": {
              "id": "3",
              "name": "Resolved"
            },
            "triggered": {
              "id": "1",
              "name": "Open"
            }
          },
          "sync_notes_user": {
            "email": "e.greenholt@example.com",
            "html_url": "https://subdomain.pagerduty.com/users/PBAZLIU",
            "id": "PBAZLIU",
            "name": "Earline Greenholt",
            "self": "https://api.pagerduty.com/users/PBAZLIU",
            "type": "user_reference"
          }
        },
        "service": {
          "html_url": "https://api.pagerduty.com/services/PY1OL64",
          "id": "PY1OL64",
          "self": "https://api.pagerduty.com/services/PY1OL64",
          "summary": "Main Web Application",
          "type": "service_reference"
        },
        "version": 1
      },
      "created_at": "2023-09-01T12:00:00.000Z",
      "id": "PF9KMXH",
      "name": "Critical Incidents to Jira",
      "updated_at": "2023-09-01T12:00:00.000Z"
    }
  ],
  "total": 1
}
```

## Response 400

Caller provided invalid arguments.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Error code. |
| `error.errors` | array of string |  | Error details. |
| `error.message` | string |  | Error message. |

Example: Response Example

```json
{
  "error": {
    "code": 2001,
    "errors": [
      "Invalid value for field 'name'"
    ],
    "message": "Invalid Input Provided"
  }
}
```

## Response 401

Caller did not supply credentials or did not provide the correct credentials.

## Response 403

Caller is not authorized to manage the requested resource. While the authentication is valid,
the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Error code. |
| `error.errors` | array of string |  | Error details. |
| `error.message` | string |  | Error message. |

Example: Response Example

```json
{
  "error": {
    "errors": [],
    "message": "Forbidden"
  }
}
```

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Error code. |
| `error.errors` | array of string |  | Error details. |
| `error.message` | string |  | Error message. |

Example: Response Example

```json
{
  "error": {
    "code": 2020,
    "message": "Rate Limit Exceeded"
  }
}
```

## Response 500

Internal server error.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Error code. |
| `error.errors` | array of string |  | Error details. |
| `error.message` | string |  | Error message. |

Example: Response Example

```json
{
  "error": {
    "errors": [],
    "message": "Internal server error"
  }
}
```

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
