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 Name | Description | Required |
---|---|---|
Title title | The title of the incident. | Yes |
Service ID service_id | The ID of the service associated with the incident. | Yes |
Urgency urgency | The urgency level of the incident. Options are "high" or "low" . | Yes |
Assign To assign_to | A list of user IDs to assign the incident to. | - |
Description description | Additional details describing the incident. | - |
Returns
A JSON object.
Required secrets
Secret Placeholder | Description |
---|---|
PAGERDUTY_SECRET | PagerDuty 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"
}
}
]
}
}