There are multiple ways to trigger an incident within PagerDuty. From the PagerDuty web UI, you can trigger an incident from inside a service of any type. Alternatively, as PagerDuty basically has two types of services - email and API - you can trigger an incident according to their respective rules.
Please note that for an incident to be triggered, there must be a user on-call for the service's escalation policy. If there is no one on call for an escalation policy, the incident will not be triggered.
Manually Opening an Incident
Manually opening an incident in a PagerDuty service will trigger a PagerDuty incident. That person will then be notified based on their configured notification rules. Typically, you would use this function if you were testing your notification rules, or if you wanted to contact the on-call person to let them know that there is an issue with a particular service.
There are a few places in PagerDuty where you can trigger an incident:
- On the Incidents page, click Create new Incident.
On the Services page you can trigger an incident by clicking New Incident.
When the Create New Incident dialog is shown, you can optionally choose a specific escalation policy or individual user. This overrides who the incident will be assigned to. Instead of notifying the escalation policy that is set for the PagerDuty service, the selected escalation policy or individual user will be notified.
When you create a manual incident and assign it to yourself, PagerDuty does not notify you. The incident is also automatically moved to the Acknowledged state since it is implied that you are aware of the incident and working to resolve it.
Send an Event to an Email Integration
If you have a Generic Email integration set up in your account, you can trigger an incident in PagerDuty by sending an email to the specified integration email.
The email address is displayed in the Integration key field under the Integrations tab on the service's page. To view this, navigate to Configuration and click on Services, then click on the service you'd like to view and the Integrations tab within that service.
When you send an email to the integration email address, an incident will be triggered in your service. You can view the trigger in the Incidents tab.
Send an Event through the API
By sending a POST request to a generic events API integration with your integration key and the necessary parameters, you can trigger an incident on a service containing an API integration.
If you have configured an API integration, you can see the relevant API documentation for detailed instructions on creating an incident via the Trigger Events endpoint.
There are also code samples in Ruby, Python, and PHP available, which includes examples to trigger incidents after substituting your details.