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

# Create a rule

`POST https://app.pagerduty.com/integration-jira-service/rules`

Creates a rule. The maximum number of rules a user could have is 2000. If the limit is reached, API will respond with an error.

> ### Action required!
>
>  Make sure that all required PagerDuty and Jira webhooks are present. You can do this by clicking **Check webhooks** button on the *Rules* page of the PagerDuty Jira application

## Authorization

- **BearerToken** (http) — HTTP bearer. PagerDuty OAuth user Access Token The developer should obtain a valid user-based bearer token by performing Classic User OAuth by following our public documentation: https://developer.pagerduty.com/docs/b2a19cce2867a-classic-user-o-auth

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `x-pagerduty-jira-signature` | string | yes | Connected Jira instance signature token This header contains a signature token that validates the connection between PagerDuty and a specific Jira instance. It must be included in all API requests. > ### Obtaining the signature token > > 1. Send an authenticated GET request to your Jira instance: `GET /plugins/servlet/pagerduty/sign` > > 2. The endpoint returns a JSON response containing the signature: `{ "signature": "eyJ0eXAiOiJK..." }` > > 3. Use the returned signature value in the x-pagerduty-jira-signature header for all subsequent API calls. Note: Signature token is valid for 15 minutes after generation. |

## Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `rule` | object | yes |  |
| `rule.name` | string | yes | A name of the rule. Max length: 128. |
| `rule.enabled` | boolean | yes | Indicates if the rule is enabled. Default: `false`. |
| `rule.config` | object | yes | Contatins an object which describes a rule. |
| `rule.config.sync_comments` | boolean |  | Indicates if comments should be synchronized. Default: `false`. |
| `rule.config.services` | array of object |  | An array of the PagerDuty services. Min items: 1. |
| `rule.config.services[].id` | string | yes |  |
| `rule.config.services[].summary` | string |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. |
| `rule.config.services[].type` | string | yes | One of: `service_reference`. |
| `rule.config.services[].self` | string (url) |  | The API show URL at which the object is accessible. |
| `rule.config.services[].html_url` | string \| null (url) |  | A URL at which the entity is uniquely displayed in the Web app. |
| `rule.config.projects` | array of object \| null |  | An array of Jira projects. Min items: 1. |
| `rule.config.projects[].id` | string | yes |  |
| `rule.config.projects[].key` | string | yes |  |
| `rule.config.projects[].label` | string | yes |  |
| `rule.config.projects[].icon` | string (url) | yes |  |
| `rule.config.projects[].html_url` | string (url) | yes |  |
| `rule.config.issue_types` | array of object \| null |  | An array of Jira issue types. Min items: 1. |
| `rule.config.issue_types[].id` | string | yes |  |
| `rule.config.issue_types[].label` | string | yes |  |
| `rule.config.issue_types[].icon` | string (url) | yes |  |
| `rule.config.autocreate_issues` | boolean |  | Indicates if automatic Jira issue creation is enabled. Default: `false`. |
| `rule.config.autocreate_issues_config` | array of object |  | An array of rules that are applied when automatic Jira issue creation is enabled. |
| `rule.config.autocreate_issues_config[].condition` | object |  |  |
| `rule.config.autocreate_issues_config[].condition.pd_events` | array of string |  | A list of PagerDuty incident actions which should be matched to create a Jira issue. |
| `rule.config.autocreate_issues_config[].condition.pd_priorities` | array of object |  | A list of PagerDuty priorities that should be matched to create/update a Jira issue. |
| `rule.config.autocreate_issues_config[].condition.pd_priorities[].id` | string | yes |  |
| `rule.config.autocreate_issues_config[].condition.pd_priorities[].summary` | string |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. |
| `rule.config.autocreate_issues_config[].condition.pd_priorities[].type` | string | yes | One of: `priority_reference`. |
| `rule.config.autocreate_issues_config[].condition.pd_priorities[].self` | string (url) |  | The API show URL at which the object is accessible. |
| `rule.config.autocreate_issues_config[].condition.pd_priorities[].html_url` | string \| null (url) |  | A URL at which the entity is uniquely displayed in the Web app. |
| `rule.config.autocreate_issues_config[].condition.pd_urgency` | string \| null |  | A PagerDuty urgency that should be matched to create/update a Jira issue. One of: `high`, `low`. |
| `rule.config.autocreate_issues_config[].actions` | array of object |  | Actions that applied when the rule will be executed. |
| `rule.config.autocreate_issues_config[].actions_params` | object |  | Configuration of actions that applied when the rule will be executed. |
| `rule.config.autocreate_issues_config[].target_project` | object \| null |  | Jira Project. |
| `rule.config.autocreate_issues_config[].target_project.id` | string | yes |  |
| `rule.config.autocreate_issues_config[].target_project.key` | string | yes |  |
| `rule.config.autocreate_issues_config[].target_project.label` | string | yes |  |
| `rule.config.autocreate_issues_config[].target_project.icon` | string (url) | yes |  |
| `rule.config.autocreate_issues_config[].target_project.html_url` | string (url) | yes |  |
| `rule.config.autocreate_issues_config[].target_issue_type` | object \| null |  | Jira Issue Type. |
| `rule.config.autocreate_issues_config[].target_issue_type.id` | string | yes |  |
| `rule.config.autocreate_issues_config[].target_issue_type.label` | string | yes |  |
| `rule.config.autocreate_issues_config[].target_issue_type.icon` | string (url) | yes |  |
| `rule.config.autocreate_incidents` | boolean |  | Indicates if automatic PagerDuty incident creation is enabled. Default: `false`. |
| `rule.config.autocreate_incidents_config` | array of object |  | An array of rules that are applied when automatic PagerDuty incident creation is enabled. |
| `rule.config.autocreate_incidents_config[].jql` | string | yes | Rule will be applied, when issue matches the JQL. |
| `rule.config.autocreate_incidents_config[].on_create` | boolean |  | Apply the rule on issue creation. Default: `false`. |
| `rule.config.autocreate_incidents_config[].on_update` | boolean |  | Apply the rule on issue update. Default: `false`. |
| `rule.config.autocreate_incidents_config[].actions` | array of object |  | Actions that applied when the rule will be executed. |
| `rule.config.autocreate_incidents_config[].actions_params` | object |  | Configuration of actions that applied when the rule will be executed. |
| `rule.config.autocreate_incidents_config[].target_service` | object |  | The reference to the service. |
| `rule.config.autocreate_incidents_config[].target_service.id` | string | yes |  |
| `rule.config.autocreate_incidents_config[].target_service.summary` | string |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. |
| `rule.config.autocreate_incidents_config[].target_service.type` | string | yes | One of: `service_reference`. |
| `rule.config.autocreate_incidents_config[].target_service.self` | string (url) |  | The API show URL at which the object is accessible. |
| `rule.config.autocreate_incidents_config[].target_service.html_url` | string \| null (url) |  | A URL at which the entity is uniquely displayed in the Web app. |
| `rule.config.react_on_incident_event` | boolean |  | Indicates if reaction on PagerDuty incident updates is enabled. Default: `false`. |
| `rule.config.react_on_incident_event_config` | array of object |  | An array of rules that are applied to the Jira issue when reaction on PagerDuty incident updates is enabled. |
| `rule.config.react_on_incident_event_config[].condition` | object |  |  |
| `rule.config.react_on_incident_event_config[].condition.pd_events` | array of string |  | A list of PagerDuty incident actions which should be matched to update a Jira issue. |
| `rule.config.react_on_incident_event_config[].condition.pd_priorities` | array of object |  | A list of PagerDuty priorities that should be matched to create/update a Jira issue. Same fields as `rule.config.autocreate_issues_config[].condition.pd_priorities` above. |
| `rule.config.react_on_incident_event_config[].condition.pd_urgency` | string \| null |  | A PagerDuty urgency that should be matched to create/update a Jira issue. One of: `high`, `low`. |
| `rule.config.react_on_incident_event_config[].actions` | array of object |  | Actions that applied when the rule will be executed. |
| `rule.config.react_on_incident_event_config[].actions_params` | object |  | Configuration of actions that applied when the rule will be executed. |
| `rule.config.react_on_incident_event_config[].target_project` | object \| null |  | Jira Project. Same fields as `rule.config.autocreate_issues_config[].target_project` above. |
| `rule.config.react_on_incident_event_config[].target_issue_type` | object |  | Issue Type, which should set on the issue. |
| `rule.config.react_on_incident_event_config[].target_issue_type.id` | string | yes |  |
| `rule.config.react_on_incident_event_config[].target_issue_type.label` | string | yes |  |
| `rule.config.react_on_incident_event_config[].target_issue_type.icon` | string (url) | yes |  |
| `rule.config.react_on_issue_status_change` | boolean |  | Indicates if reaction on Jira issue status change is enabled. Default: `false`. |
| `rule.config.react_on_issue_status_change_config` | array of object |  | An array of rules that are applied to the PagerDuty incident when reaction on Jira issue status change is enabled. |
| `rule.config.react_on_issue_status_change_config[].jira_statuses` | array of object |  |  |
| `rule.config.react_on_issue_status_change_config[].jira_statuses[].id` | string | yes |  |
| `rule.config.react_on_issue_status_change_config[].jira_statuses[].label` | string |  |  |
| `rule.config.react_on_issue_status_change_config[].actions` | array of object |  | Actions that applied when the rule will be executed. |
| `rule.config.react_on_issue_status_change_config[].actions_params` | object |  | Configuration of actions that applied when the rule will be executed. |
| `rule.created_at` | string (date-time) | yes | The date/time rule was created. Read-only. |

Example: Request Example

```json
{
  "rule": {
    "name": "Sample Rule",
    "created_at": "2020-06-02T12:42:37Z",
    "enabled": true,
    "config": {
      "sync_comments": true,
      "services": [
        {
          "id": "PLW70S2",
          "type": "service_reference",
          "label": "Jira Integration",
          "html_url": "https://subdomain.pagerduty.com/service-directory/PLW70S2"
        },
        {
          "id": "PR5R1T1",
          "type": "service_reference",
          "label": "Jira Performance Tests",
          "html_url": "https://subdomain.pagerduty.com/service-directory/PR5R1T1"
        }
      ],
      "projects": [
        {
          "key": "PD",
          "id": "10000",
          "label": "PagerDuty",
          "html_url": "http://jira.example.com/projects/PD",
          "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
        },
        {
          "key": "HD",
          "id": "10001",
          "label": "Helpdesk",
          "html_url": "http://jira.example.com/projects/HD",
          "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
        }
      ],
      "issue_types": [
        {
          "id": "10002",
          "icon": "http://jira.example.com/images/icons/issuetypes/story.svg",
          "label": "Story"
        },
        {
          "id": "10003",
          "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
          "label": "Task"
        },
        {
          "id": "10004",
          "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
          "label": "Bug"
        }
      ],
      "autocreate_incidents": true,
      "autocreate_incidents_config": [
        {
          "jql": "issuetype=Bug",
          "on_create": true,
          "on_update": true,
          "target_service": {
            "id": "PR5R1T1",
            "type": "service_reference"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "jira_field_set_labels",
              "label": "Set Labels",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "pd_set_priority",
              "label": "Set Incident Priority",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Highest",
              "icon": "http://jira.example.com/images/icons/priorities/highest.svg",
              "name": "Highest",
              "id": "1"
            },
            "jira_field_set_labels": [
              {
                "label": "Service name",
                "icon": "pd",
                "key": "incident.service.summary"
              }
            ],
            "pd_set_priority": {
              "id": "PZQ39X0",
              "type": "priority_reference",
              "label": "P1",
              "html_url": null,
              "icon": "rect_color_ff4500"
            }
          }
        },
        {
          "jql": "issuetype=Story",
          "on_create": true,
          "on_update": true,
          "target_service": {
            "id": "PR5R1T1",
            "type": "service_reference"
          },
          "actions": [
            {
              "key": "jira_field_set_labels",
              "label": "Set Labels",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "pd_set_priority",
              "label": "Set Incident Priority",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_labels": [
              {
                "label": "LinkedToPagerduty",
                "key": "LinkedToPagerduty",
                "icon": "text"
              }
            ],
            "pd_set_priority": {
              "id": "PCNJ47O",
              "type": "priority_reference",
              "label": "P4",
              "html_url": null,
              "icon": "rect_color_76ec7f"
            }
          }
        }
      ],
      "autocreate_issues": true,
      "autocreate_issues_config": [
        {
          "condition": {
            "pd_events": [
              "incident.trigger",
              "incident.acknowledge",
              "incident.unacknowledge",
              "incident.resolve",
              "incident.escalate",
              "incident.assign",
              "incident.delegate",
              "incident.trigger_manually"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "target_project": null,
          "target_issue_type": null,
          "actions": [
            {
              "key": "jira_append_description",
              "label": "Add description",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_append_description": [
              {
                "label": "Incident title",
                "icon": "pd",
                "key": "incident.title"
              },
              {
                "label": "Incident number",
                "icon": "pd",
                "key": "incident.incident_number"
              },
              {
                "label": "Incident ID",
                "icon": "pd",
                "key": "incident.id"
              },
              {
                "label": "Description",
                "icon": "pd",
                "key": "log_entries.channel.details"
              },
              {
                "label": "Status",
                "icon": "pd",
                "key": "incident.status"
              },
              {
                "label": "Created At",
                "icon": "pd",
                "key": "incident.created_at"
              },
              {
                "label": "Service name",
                "icon": "pd",
                "key": "incident.service.summary"
              },
              {
                "label": "Escalation policy name",
                "icon": "pd",
                "key": "incident.escalation_policy.summary"
              },
              {
                "label": "Impacted services",
                "icon": "pd",
                "key": "incident.impacted_services.name"
              },
              {
                "label": "Incident URL",
                "icon": "pd",
                "key": "incident.html_url"
              },
              {
                "label": "Acknowledgements",
                "icon": "pd",
                "key": "incident.acknowledgements.acknowledger.name"
              },
              {
                "label": "Urgency",
                "icon": "pd",
                "key": "incident.urgency"
              },
              {
                "label": "Incident assignee",
                "icon": "pd",
                "key": "incident.assignee"
              },
              {
                "label": "Priority",
                "icon": "pd",
                "key": "incident.priority.summary"
              },
              {
                "label": "Last changed by",
                "icon": "pd",
                "key": "incident.last_status_change_by.summary"
              },
              {
                "label": "Last changed at",
                "icon": "pd",
                "key": "incident.last_status_change_at"
              },
              {
                "label": "And my custom text",
                "key": "And my custom text",
                "icon": "text"
              }
            ]
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.trigger"
            ],
            "pd_urgency": "high",
            "pd_priorities": [
              {
                "id": "PZQ39X0",
                "type": "priority_reference",
                "label": "P1",
                "html_url": null,
                "icon": "rect_color_ff4500"
              },
              {
                "id": "POV67SK",
                "type": "priority_reference",
                "label": "P2",
                "html_url": null,
                "icon": "rect_color_f59331"
              }
            ]
          },
          "target_project": {
            "key": "HD",
            "id": "10001",
            "label": "Helpdesk",
            "html_url": "http://jira.example.com/projects/HD",
            "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
          },
          "target_issue_type": {
            "id": "10004",
            "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
            "label": "Bug"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Highest",
              "icon": "http://jira.example.com/images/icons/priorities/highest.svg",
              "name": "Highest",
              "id": "1"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.trigger"
            ],
            "pd_urgency": "low",
            "pd_priorities": [
              {
                "id": "P0A95OH",
                "type": "priority_reference",
                "label": "P3",
                "html_url": null,
                "icon": "rect_color_359d54"
              },
              {
                "id": "PCNJ47O",
                "type": "priority_reference",
                "label": "P4",
                "html_url": null,
                "icon": "rect_color_76ec7f"
              },
              {
                "id": "PRSM238",
                "type": "priority_reference",
                "label": "P5",
                "html_url": null,
                "icon": "rect_color_f4f4f4"
              }
            ]
          },
          "target_project": null,
          "target_issue_type": {
            "id": "10004",
            "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
            "label": "Bug"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Low",
              "icon": "http://jira.example.com/images/icons/priorities/low.svg",
              "name": "Low",
              "id": "4"
            }
          }
        }
      ],
      "react_on_incident_event": true,
      "react_on_incident_event_config": [
        {
          "condition": {
            "pd_events": [
              "incident.acknowledge"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "3",
              "label": "In Progress"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.unacknowledge"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "10000",
              "label": "To Do"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.resolve"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "10001",
              "label": "Done"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.assign"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_field_set_assignee",
              "label": "Set Assignee",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_assignee": {
              "label": "Incident assignee",
              "icon": "pd",
              "key": "incident.assignee"
            }
          }
        }
      ],
      "react_on_issue_status_change": true,
      "react_on_issue_status_change_config": [
        {
          "jira_statuses": [
            {
              "id": "3",
              "label": "In Progress"
            }
          ],
          "actions": [
            {
              "key": "pd_acknowledge",
              "label": "Acknowledge Incident",
              "icon": "pd",
              "isDisabled": false
            }
          ]
        },
        {
          "jira_statuses": [
            {
              "id": "10001",
              "label": "Done"
            }
          ],
          "actions": [
            {
              "key": "pd_resolve",
              "label": "Resolve Incident",
              "icon": "pd",
              "isDisabled": false
            }
          ]
        },
        {
          "jira_statuses": [
            {
              "id": "10000",
              "label": "To Do"
            }
          ],
          "actions": [
            {
              "key": "pd_add_responders",
              "label": "Add responders",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "pd_add_responders": [
              {
                "id": "PDU13T4",
                "type": "user_reference",
                "email": "user1@example.com",
                "label": "User 1",
                "html_url": "https://subdomain.pagerduty.com/users/PDU13T4",
                "icon": "https://pd-static-assets.pagerduty.com/users/blank-avatar.png"
              },
              {
                "id": "PKH7YP2",
                "type": "user_reference",
                "email": "user2@example.com",
                "label": "User 2",
                "html_url": "https://subdomain.pagerduty.com/users/PKH7YP2",
                "icon": "https://pd-static-assets.pagerduty.com/users/blank-avatar.png"
              }
            ]
          }
        }
      ]
    }
  }
}
```

## Response 200

The rule that was created.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `rule` | object | yes | Same fields as `rule` above. |

Example: Response Example

```json
{
  "rule": {
    "name": "Sample Rule",
    "created_at": "2020-06-02T12:42:37Z",
    "enabled": true,
    "config": {
      "sync_comments": true,
      "services": [
        {
          "id": "PLW70S2",
          "type": "service_reference",
          "label": "Jira Integration",
          "html_url": "https://subdomain.pagerduty.com/service-directory/PLW70S2"
        },
        {
          "id": "PR5R1T1",
          "type": "service_reference",
          "label": "Jira Performance Tests",
          "html_url": "https://subdomain.pagerduty.com/service-directory/PR5R1T1"
        }
      ],
      "projects": [
        {
          "key": "PD",
          "id": "10000",
          "label": "PagerDuty",
          "html_url": "http://jira.example.com/projects/PD",
          "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
        },
        {
          "key": "HD",
          "id": "10001",
          "label": "Helpdesk",
          "html_url": "http://jira.example.com/projects/HD",
          "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
        }
      ],
      "issue_types": [
        {
          "id": "10002",
          "icon": "http://jira.example.com/images/icons/issuetypes/story.svg",
          "label": "Story"
        },
        {
          "id": "10003",
          "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
          "label": "Task"
        },
        {
          "id": "10004",
          "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
          "label": "Bug"
        }
      ],
      "autocreate_incidents": true,
      "autocreate_incidents_config": [
        {
          "jql": "issuetype=Bug",
          "on_create": true,
          "on_update": true,
          "target_service": {
            "id": "PR5R1T1",
            "type": "service_reference"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "jira_field_set_labels",
              "label": "Set Labels",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "pd_set_priority",
              "label": "Set Incident Priority",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Highest",
              "icon": "http://jira.example.com/images/icons/priorities/highest.svg",
              "name": "Highest",
              "id": "1"
            },
            "jira_field_set_labels": [
              {
                "label": "Service name",
                "icon": "pd",
                "key": "incident.service.summary"
              }
            ],
            "pd_set_priority": {
              "id": "PZQ39X0",
              "type": "priority_reference",
              "label": "P1",
              "html_url": null,
              "icon": "rect_color_ff4500"
            }
          }
        },
        {
          "jql": "issuetype=Story",
          "on_create": true,
          "on_update": true,
          "target_service": {
            "id": "PR5R1T1",
            "type": "service_reference"
          },
          "actions": [
            {
              "key": "jira_field_set_labels",
              "label": "Set Labels",
              "icon": "jira",
              "isDisabled": false
            },
            {
              "key": "pd_set_priority",
              "label": "Set Incident Priority",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_labels": [
              {
                "label": "LinkedToPagerduty",
                "key": "LinkedToPagerduty",
                "icon": "text"
              }
            ],
            "pd_set_priority": {
              "id": "PCNJ47O",
              "type": "priority_reference",
              "label": "P4",
              "html_url": null,
              "icon": "rect_color_76ec7f"
            }
          }
        }
      ],
      "autocreate_issues": true,
      "autocreate_issues_config": [
        {
          "condition": {
            "pd_events": [
              "incident.trigger",
              "incident.acknowledge",
              "incident.unacknowledge",
              "incident.resolve",
              "incident.escalate",
              "incident.assign",
              "incident.delegate",
              "incident.trigger_manually"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "target_project": null,
          "target_issue_type": null,
          "actions": [
            {
              "key": "jira_append_description",
              "label": "Add description",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_append_description": [
              {
                "label": "Incident title",
                "icon": "pd",
                "key": "incident.title"
              },
              {
                "label": "Incident number",
                "icon": "pd",
                "key": "incident.incident_number"
              },
              {
                "label": "Incident ID",
                "icon": "pd",
                "key": "incident.id"
              },
              {
                "label": "Description",
                "icon": "pd",
                "key": "log_entries.channel.details"
              },
              {
                "label": "Status",
                "icon": "pd",
                "key": "incident.status"
              },
              {
                "label": "Created At",
                "icon": "pd",
                "key": "incident.created_at"
              },
              {
                "label": "Service name",
                "icon": "pd",
                "key": "incident.service.summary"
              },
              {
                "label": "Escalation policy name",
                "icon": "pd",
                "key": "incident.escalation_policy.summary"
              },
              {
                "label": "Impacted services",
                "icon": "pd",
                "key": "incident.impacted_services.name"
              },
              {
                "label": "Incident URL",
                "icon": "pd",
                "key": "incident.html_url"
              },
              {
                "label": "Acknowledgements",
                "icon": "pd",
                "key": "incident.acknowledgements.acknowledger.name"
              },
              {
                "label": "Urgency",
                "icon": "pd",
                "key": "incident.urgency"
              },
              {
                "label": "Incident assignee",
                "icon": "pd",
                "key": "incident.assignee"
              },
              {
                "label": "Priority",
                "icon": "pd",
                "key": "incident.priority.summary"
              },
              {
                "label": "Last changed by",
                "icon": "pd",
                "key": "incident.last_status_change_by.summary"
              },
              {
                "label": "Last changed at",
                "icon": "pd",
                "key": "incident.last_status_change_at"
              },
              {
                "label": "And my custom text",
                "key": "And my custom text",
                "icon": "text"
              }
            ]
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.trigger"
            ],
            "pd_urgency": "high",
            "pd_priorities": [
              {
                "id": "PZQ39X0",
                "type": "priority_reference",
                "label": "P1",
                "html_url": null,
                "icon": "rect_color_ff4500"
              },
              {
                "id": "POV67SK",
                "type": "priority_reference",
                "label": "P2",
                "html_url": null,
                "icon": "rect_color_f59331"
              }
            ]
          },
          "target_project": {
            "key": "HD",
            "id": "10001",
            "label": "Helpdesk",
            "html_url": "http://jira.example.com/projects/HD",
            "icon": "http://jira.example.com/secure/projectavatar?avatarId=10324"
          },
          "target_issue_type": {
            "id": "10004",
            "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
            "label": "Bug"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Highest",
              "icon": "http://jira.example.com/images/icons/priorities/highest.svg",
              "name": "Highest",
              "id": "1"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.trigger"
            ],
            "pd_urgency": "low",
            "pd_priorities": [
              {
                "id": "P0A95OH",
                "type": "priority_reference",
                "label": "P3",
                "html_url": null,
                "icon": "rect_color_359d54"
              },
              {
                "id": "PCNJ47O",
                "type": "priority_reference",
                "label": "P4",
                "html_url": null,
                "icon": "rect_color_76ec7f"
              },
              {
                "id": "PRSM238",
                "type": "priority_reference",
                "label": "P5",
                "html_url": null,
                "icon": "rect_color_f4f4f4"
              }
            ]
          },
          "target_project": null,
          "target_issue_type": {
            "id": "10004",
            "icon": "http://jira.example.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
            "label": "Bug"
          },
          "actions": [
            {
              "key": "jira_field_set_priority",
              "label": "Set Priority",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_priority": {
              "label": "Low",
              "icon": "http://jira.example.com/images/icons/priorities/low.svg",
              "name": "Low",
              "id": "4"
            }
          }
        }
      ],
      "react_on_incident_event": true,
      "react_on_incident_event_config": [
        {
          "condition": {
            "pd_events": [
              "incident.acknowledge"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "3",
              "label": "In Progress"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.unacknowledge"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "10000",
              "label": "To Do"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.resolve"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_change_status",
              "label": "Change Jira issue status to",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_change_status": {
              "id": "10001",
              "label": "Done"
            }
          }
        },
        {
          "condition": {
            "pd_events": [
              "incident.assign"
            ],
            "pd_urgency": "high",
            "pd_priorities": []
          },
          "actions": [
            {
              "key": "jira_field_set_assignee",
              "label": "Set Assignee",
              "icon": "jira",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "jira_field_set_assignee": {
              "label": "Incident assignee",
              "icon": "pd",
              "key": "incident.assignee"
            }
          }
        }
      ],
      "react_on_issue_status_change": true,
      "react_on_issue_status_change_config": [
        {
          "jira_statuses": [
            {
              "id": "3",
              "label": "In Progress"
            }
          ],
          "actions": [
            {
              "key": "pd_acknowledge",
              "label": "Acknowledge Incident",
              "icon": "pd",
              "isDisabled": false
            }
          ]
        },
        {
          "jira_statuses": [
            {
              "id": "10001",
              "label": "Done"
            }
          ],
          "actions": [
            {
              "key": "pd_resolve",
              "label": "Resolve Incident",
              "icon": "pd",
              "isDisabled": false
            }
          ]
        },
        {
          "jira_statuses": [
            {
              "id": "10000",
              "label": "To Do"
            }
          ],
          "actions": [
            {
              "key": "pd_add_responders",
              "label": "Add responders",
              "icon": "pd",
              "isDisabled": false
            }
          ],
          "actions_params": {
            "pd_add_responders": [
              {
                "id": "PDU13T4",
                "type": "user_reference",
                "email": "user1@example.com",
                "label": "User 1",
                "html_url": "https://subdomain.pagerduty.com/users/PDU13T4",
                "icon": "https://pd-static-assets.pagerduty.com/users/blank-avatar.png"
              },
              {
                "id": "PKH7YP2",
                "type": "user_reference",
                "email": "user2@example.com",
                "label": "User 2",
                "html_url": "https://subdomain.pagerduty.com/users/PKH7YP2",
                "icon": "https://pd-static-assets.pagerduty.com/users/blank-avatar.png"
              }
            ]
          }
        }
      ]
    }
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object | yes |  |
| `error.message` | string | yes | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

Example: Invalid input provided

```json
{
  "error": {
    "message": "Invalid Input Provided"
  }
}
```

Example: Validation error

```json
{
  "error": {
    "errors": [
      "Name can't be blank"
    ],
    "message": "Invalid Input Provided"
  }
}
```

Example: Malformed json

```json
{
  "error": {
    "message": "Malformed json"
  }
}
```

## Response 403

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

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object | yes |  |
| `error.message` | string | yes | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

Example: Authorization Error

```json
{
  "error": {
    "message": "Authorization error"
  }
}
```

## Response 422

Unprocessable Entity. Some arguments failed validation checks.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object | yes |  |
| `error.message` | string | yes | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

Example: Unprocessable Entity

```json
{
  "error": {
    "message": "Unprocessable Entity"
  }
}
```

## 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).
