Integrations
Pagerduty
APIs
Create Incident

Create Incident

Create a new incident in PagerDuty using the provided incident details such as title, service ID, urgency, and optional assignees.

For more information on the PagerDuty API, see PagerDuty Incident Creation API (opens in a new tab).

SDK Import:

from admyral.actions import create_pagerduty_incident

Arguments:

Argument NameDescriptionRequired
Title titleThe title of the incident.Yes
Service ID service_idThe ID of the service associated with the incident.Yes
Urgency urgencyThe urgency level of the incident. Options are "high" or "low".Yes
Assign To assign_toA list of user IDs to assign the incident to.-
Description descriptionAdditional details describing the incident.-

Returns

A JSON object.

Required secrets

Secret PlaceholderDescription
PAGERDUTY_SECRETPagerDuty secret. See PagerDuty setup

SDK Example

incident = create_pagerduty_incident(
	title="New case created",
	service_id="PS16N1G",
	urgency="high",
	assign_to=["PM36128"],
	description="My loooooong and highly detailed incident description",
	secrets={"PAGERDUTY_SECRET": "my_stored_pagerduty_secret"},
)

Example Output:

{
	"incident": {
		"title": "Your desk is on fire!",
		"service": {
			"id": "PW7YESS",
			"type": "service_reference"
		},
		"assignments": [
			{
				"assignee": {
					"id": "PZUVZZZ",
					"type": "user_reference"
				}
			}
		]
	}
}