Skip to main content

Send notifications to Opsgenie

You can configure APEX AIOps Incident Management to forward incidents to an Opsgenie team using an incident webhook endpoint.

Before you begin

Before you set up your Opsgenie outbound integration:

  • Make sure you are signed into your Incident Management instance.

  • Make sure you are signed into Opsgenie.

Set up an inbound integration in Opsgenie

  1. Open Opsgenie. From the top menu, click Teams.

  2. Choose or create the team that will be responsible for the Incident Management integration.

  3. From the team page, navigate to Integrations > Add integration.

  4. Click the API tile.

  5. Provide a unique name for the integration, such as "Incident Management."

  6. Click Continue.

  7. On the Integrations settings page of your new integration, copy the API key and save it for use later on.

  8. Click Edit to check your Integration settings.

  9. In the Edit integration settings window that appears, verify that Allow Create and Update Access is enabled.

  10. Click Save.

  11. Click Turn on Integration.

Configure the CREATE webhook endpoint in Incident Management

Once you have finished configuring the properties in Opsgenie, you must create new incident webhook endpoints in Incident Management in order to send data to Opsgenie. This section explains how to set up the Opsgenie CREATE webhook endpoint, which creates new incidents in Opsgenie when incidents are processed in Incident Management.

To configure the CREATE webhook endpoint:

  1. Log into Incident Management and navigate to Integrations > Outbound Integrations > Webhook Endpoint > Incident Webhook Endpoint.

  2. Click Add Incident Webhook Endpoint and enter "Opsgenie CREATE" as the name of the webhook endpoint. Optionally, provide a description.

  3. Complete each section of the webhook endpoint according to the following:

    1. Skip the Triggers section.

    2. Configure the Endpoint:

      1. Set the request method to POST.

      2. Under URL, copy and paste the following:

        https://api.opsgenie.com/v2/alerts
      3. Under Authorization, select No auth. This should already be the default value.

      4. Under Headers, add a new row with the following parameters. Replace <Opsgenie API Key> with the API key that you copied from Opsgenie:

        • Key: Authorization

        • Value: GenieKey <Opsgenie API Key>

    3. Specify the Payload Body:

      1. Replace the default payload with the following:

        {"description":"Incident Management Issue #$id with severity $severity and description $description at $incident_url is $status", "message":"$description"}
      2. Scroll up to the top of the page and click Test in the upper right-hand corner. You should see response details and a confirmation that the webhook endpoint is configured correctly.

      3. Make additional payload adjustments according to your business needs. To learn more about fine-tuning your outbound payload, read Configure the CREATE payload body for a webhook endpoint.

    4. Save the webhook endpoint.

Configure the UPDATE webhook endpoint in Incident Management

Next, create an Opsgenie UPDATE webhook endpoint, which updates Opsgenie incidents when their corresponding Incident Management incidents are updated.

To configure the UPDATE webhook endpoint:

  1. Navigate to Integrations > Outbound Integrations > Webhook Endpoint > Incident Webhook Endpoint.

  2. At the far right side of the "Opsgenie CREATE" webhook endpoint you just configured, click on the copy icon:

    OpsgenieDuplicate.png
  3. Enter "Opsgenie UPDATE" for the name of the duplicate webhook endpoint and click Duplicate.

  4. Click on the "Opsgenie UPDATE" webhook endpoint to open it.

  5. Click Edit.

  6. Under the Triggers section, select the conditions that you would like to trigger the webhook endpoint.

  7. Skip to the Payload Body section:

    1. Replace the existing payload with the following:

      {"description":"Updated Incident Management Issue #$id with severity $severity and description $description is $status", "message":"$description"}
    2. Scroll up to the top of the page and click Test in the upper right-hand corner. You should see response details and a confirmation that the webhook endpoint is configured correctly.

    3. Make additional payload adjustments according to your business needs. To learn more about fine-tuning your outbound payload, read Configure the UPDATE payload body for a webhook endpoint.

  8. Save the webhook endpoint.

Configure the CREATE workflow in Incident Management

Configure an incident workflow called Opsgenie CREATE Workflow, which triggers the "Opsgenie CREATE" webhook endpoint when an incident is created in Incident Management.

To configure the CREATE workflow:

  1. Navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Opsgenie CREATE Workflow" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select New incidents only.

    If desired, add a filter condition on the incidents that you wish to forward to Opsgenie.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action complete each section according to the following:

    1. Webhook: Select the "Opsgenie CREATE" incident webhook endpoint that you created earlier.

    2. External Link: Skip this section.

    3. Integration Name: Enter the following (without quotes): "Opsgenie Integration"

      Skip all remaining sections.

  6. Save and Enable the workflow.

Configure the UPDATE workflow in Incident Management

Finally, configure another incident workflow called Opsgenie UPDATE Workflow, which triggers the "Opsgenie UPDATE" webhook endpoint to send data when an incident is updated in Incident Management.

To configure the UPDATE workflow:

  1. Navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Opsgenie UPDATE Workflow" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select Changed incidents only.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action and complete each section as follows:

    1. Webhook: Select the "Opsgenie UPDATE" incident webhook endpoint that you created earlier.

    2. External Link: Skip this section.

    3. Integration Name: Enter the following (without quotes): "Opsgenie Integration"

      Skip all remaining sections.

  6. Save and Enable the workflow.

Test the integration

  1. Navigate to Integrations > Ingestion Services > Events API.

  2. Add your API key to the provided cURL command and run the command in an external terminal to send an event to Incident Management.

  3. Verify that an incident has been created in Incident Management.

  4. Within Opsgenie, verify that an incident notification has arrived. You should also see the test notification(s) you sent earlier.

  5. If you have enabled updates and included Status changed as a trigger, close the incident in Incident Management and verify in Opsgenie that an update notification has arrived.