curl -X POST "https://example.com/rules" \ -H "x-pagerduty-jira-signature: {x-pagerduty-jira-signature}" \ -H "Content-Type: application/json" \ -d '{ "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://secure.gravatar.com/avatar/0787c04e4eb52aa05d2c94bac8293c83.png?d=mm&r=PG" }, { "id": "PKH7YP2", "type": "user_reference", "email": "user2@example.com", "label": "User 2", "html_url": "https://subdomain.pagerduty.com/users/PKH7YP2", "icon": "https://secure.gravatar.com/avatar/7358657a3a25a1ab291289aaf38afcba.png?d=mm&r=PG" } ] } } ] } } }'