Custom Incident Actions
Custom incident actions allow incident responders to quickly execute custom logic that is housed outside of the PagerDuty system. Customers can host their own custom scripts that execute when these actions are triggered, which provides users with a nearly limitless number of possible actions.
Create a Custom Incident Action
Required User Permissions
- Managers, Global Admins and Account Owners can create custom incident actions.
- Responder users with a Manager Team role can create custom incident actions for services associated with their Team.
- Go to Integrations Extensions.
- Click New Extension in the Service Extensions tab and search for ‘Custom Incident Action’, as the Extension Type. On the modal that appears, click Open Custom Incident Actions Page.
- From here you will be taken to the Custom Incident Action extension page. If you have not yet created any custom actions, the page will display a message with information about custom incident actions. Select New Action to create your new action.
- Enter the following fields:
- Button Label: Enter a name for the button that will appear in incidents.
- URL Endpoint: Enter the URL endpoint where we will be sending the HTTP POST requests when the custom incident action button is selected.
- Description: Enter a description of what will happen when users click the custom incident action button.
- Select Service: Select the service where you would like incidents to display this button.
- Custom Headers (Optional): Click Add Custom Header and enter a Header Name and Header Value. These headers will be included on each webhook sent from this custom incident action. You may click Add Custom Header again to add multiple custom headers. Note: With V3 Webhook Subscriptions, all header names must be unique. To delete a custom header, click the to the right.
- When you have finished configuring your custom action, click Create Action.
For more information about the payload you will receive through a PagerDuty webhook, please visit our Developer Documentation.
![custom-incident-actions-new-action.png Create a Custom Incident Action](https://files.readme.io/6fb4269-custom-incident-actions-new-action.png)
Create a Custom Incident Action
Edit a Custom Incident Action
- Navigate to Integrations Extensions and find Custom Incident Action in the extensions list. Click Edit on the Custom Incident Actions Extension page to the right.
- Click the to the right of your desired custom incident action and select Edit.
- Make the necessary changes and then click Save Changes.
Copy the Custom Incident Action Webhook ID
- Navigate to Integrations Extensions and find Custom Incident Action in the extensions list. Click Edit on the Custom Incident Actions Extension page to the right.
- Click the to the right of your desired custom incident action and select Copy webhook ID.
Remove a Custom Incident Action
- Navigate to Integrations Extensions and find Custom Incident Action in the extensions list. Click Edit on the Custom Incident Actions Extension page to the right.
- Click the to the right of your desired custom incident action and select Remove.
- On the confirmation dialog, click Delete.
Execute a Custom Incident Action
Required User Permissions
Responders, Managers, Global Admins and Account Owners can execute custom incident actions. Observers can execute custom incident actions on incidents they are assigned to.
Once you have created your custom action, you will see the action button available on all incidents on that service under More Actions.
![custom-incident-actions-incident-button.png Execute a Custom Incident Action](https://files.readme.io/131006d-custom-incident-actions-incident-button.png)
Execute a Custom Incident Action
When a user clicks the custom incident action button in an incident, it will fire an HTTP POST request with data on the incident to the endpoint URL specified during configuration. You can then build a script that listens for this request and executes custom logic when a request is received.
Note
There is a maximum of three custom incident actions per service.
Common Use Cases
Restart Server
Create a Restart Server button on your incidents that, when selected, restarts the server associated with the incident. The custom action POST request will include details on the incident that would allow a single script to dynamically determine the server in need of a restart.
Add Diagnostics
Create an Add Diagnostics button that fetches diagnostic data on the affected infrastructure and appends the data as a note on your PagerDuty incident. This gives your users visibility into key infrastructure data right in the PagerDuty incident.
Revert Last Commit
Create a Revert Last Commit button that will revert the last commit in your repository that houses the source code for the affected service. This allows your users to quickly roll-back a bad deploy without leaving the PagerDuty platform.
Update Status Page
Create an Update Status Page button that will let your users update your status page with one click. This lets your users update your customers as soon as an incident occurs.
Updated 3 months ago