Skip to main content
No Result Found

Integrate OpsGenie with webhooks

Learn to automate OpsGenie alerts using webhooks in Test Observability.

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

Follow these steps to integrate webhooks with OpsGenie:

  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 OpsGenie incident.
  5. By default, POST method and the URL to OpsGenie’s alerts 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. You can include variables by clicking the Variables menu and selecting any variable.
     {
     "tags": [ 
         // Tags to categorize or label the event.
         "test-failure", 
         // Indicates the event is related to a test failure.
         "automated" 
         // Suggests the event was created automatically by a system or tool.
     ],
    
     "alias": "", 
     // A unique identifier for the event, dynamically populated using the test hash.
    
     "details": { 
         // Contains additional metadata about the event.
         "gitSha": "", 
         // The specific Git commit SHA associated with the event.
         "buildId": "", 
         // The unique ID of the build where the test failure occurred.
         "gitBranch": "", 
         // The Git branch related to the build and test failure.
         "buildNumber": "" 
         // The build number, often used for tracking and debugging.
     },
    
     "message": "Test Failure: ", 
     // A short message summarizing the event, dynamically including the test name.
    
     "priority": "P2", 
     // Add the priority level of the event.
    
     "description": "Build Information:\nBuild Name: \nBuild Status: \nBuild Duration: \n\nTest Information:\nTest Name: \nTest Duration: \nError: \n\nView detailed report: " 
     // A detailed description of the event, dynamically populated with placeholders for build and test details, including a link to the full report.
     }
    
  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 OpsGenie simplifies the integration. However, you can also refer to the original API to create an incident in OpsGenie.

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