Skip to main content
No Result Found

Integrate PagerDuty with webhooks

Learn to integrate PagerDuty using webhooks.

BrowserStack Test Observability provides custom payload templates to integrate webhooks with PagerDuty.

Follow these steps to integrate webhooks with PagerDuty:

  1. Open Settings > Webhooks of your project and click Create webhook.
  2. Enter a webhook name and select an event type.
  3. Click Add trigger condition and configure filters from the available options.
  4. Click Create PagerDuty incident.
  5. By default, POST method and the URL to PagerDuty’s create incidents API is selected. You can select PUT method or change the URL if you need to. You can also click + to add variables to the URL.
  6. Edit the payload body including the variables and key-value pairs according to your specific use case. Ensure that you fill all the required fields like service id. You can include variables by clicking the Variables menu and selecting any variable.
    {
      "incident": { 
     "type": "incident", 
     // Specifies the type of object being defined, in this case, an "incident".
     "title": " or  failing", 
     // The title of the incident, using placeholders to dynamically populate the build or test name.
    
     "service": {
       "id": "<your-service-id> here", 
       // Replace with the unique service ID associated with the incident.
       "type": "service_reference" 
       // Specifies the type of reference, linking to a specific service.
     },
        
     "priority": {
       "id": "<your-priority-id>", 
       // Replace with the unique ID defining the priority level of the incident.
       "type": "priority_reference" 
       // Specifies the type of reference, linking to a priority definition.
     },
        
     "urgency": "high", 
     // Defines the urgency level of the incident, e.g., "low", "medium", "high".
    
     "body": {
       "type": "incident_body", 
       // Specifies the type of object being defined, in this case, the body of the incident.
       "details": "Tests from  are failing. More information available at . This payload body is customizable."
       // The detailed description of the incident, with placeholders for dynamic information like the build name and observability URL.
     }
      }
    }
    
  7. Select the type of Authorization from the Authorization tab.
  8. Add optional headers as key-value pairs from the Headers tab.
  9. Add optional parameters as key-value pairs from the Parameters tab.
  10. Switch on Re-trigger webhook if the build starts passing if you want to retrigger the webhook when the build passes.
  11. Click Test Webhook.
  12. Click Create.

These steps using the built-in template for PagerDuty simplifies the integration. However, you can also refer to the original API to create an incident in PagerDuty.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle