Create GitLab issues from PagerDuty Incidents

Problem to solve

Responders need to be automatically notified when an alert is triggered. PagerDuty is one of the most common on-call and paging tools in market and is used by many of our enterprise customers. We want to enable the creation of an issue via API from a PagerDuty incident.

Intended users

Further details

Proposal

Create webhook that receives PagerDuty incidents and creates GitLab issues in a specific project. The issue will need to be automatically labeled incident. These issues should contain the payload, any annotations, and a link back to the incident in PagerDuty.

WIP Design

Configuration

As outlined on #119019, the plan is to combine configuration sections for this issue and #119019 into a single space within Settings > Operations > Incidents.

We are assuming that the following are needed to create GitLab issues from PD incidents:

Users will need to set up a webhook (which requires a URL and a secret token)

Users will need to check a checkbox to allow for the creation of GitLab issues from PagerDuty incidents. If this checkbox is checked, all incidents will create incident issues within GitLab.

These fields are highlighted in the mock-up below:

Still TBC in the designs: if the fields shown are sufficient for both creating incidents from GitLab issues, and for creating issues for PagerDuty incidents. We've requested engineering input to review and discuss.

Issue created from PagerDuty incident

In referencing the PagerDuty API, it seems like we could populate the summary section of incident issues created from PagerDuty with the following information:

Title

Status (statuses)

Opened (which presumably could be a combination of the since and timezone keys)

Assignee (user_ids)

Urgency (urgencies)

Incident key (incident_key)

Impacted service (service_ids)

...And add the incident label as a default for all issues created from PagerDuty?

It's not clear if we'll have anything we can populate with Incident details sections with, however. If we don't have anything to show, perhaps we can consider not adding the details section to the Incident issue automatically. If, however, we are able to pull the PagerDuty incident timeline, that would be a valuable addition to/replacement for the Details section of the Incident issue.