Incident Remediation Using Webhook Events

As an administrator, responsible for hardware infrastructure, you can use Webhook Event objects with your ticketing system for incident remediation. This object works with the Event Engine feature and helps you solve routine incidents quickly, saving you time to solve more challenging problems.

More Information:

This Event Engine feature can be used to react to internal and external events. The following use case is based on an external event that uses a Webhook Event object to listen and receive incoming external event payloads.

This page includes the following:

What Will You Learn?

Prerequisites

To use the Webhook Event feature, the following components and knowledge are required:

Note: If they are not listed in the Explorer sidebar, then you need to download them from our marketplace on https://marketplace.automic.com/ and install them. For instructions about installing an action pack, see Installing Packs in Working with Packs and Plug-ins.

More information:

Use Case Description

This example is based on the following scenario:

The following diagram shows the incident remediation process:

Diagram shows the incident remediation process

Create a Scoped API Key

Webhook endpoints require a scoped API key. The scoped key must be generated for the client on which the Webhook object is running. If the external webhook API (for example, JIRA) is unable to send the authorization key in the HTTP header, it can also be provided as an URL parameter.

 

Example:

http://host:port/analytics/api/v1/100/12345?authorization=1cb812db-6616-49da-af97-3719aeaddc24

 

For further information, see Analytics REST API - General Info

Create an IA Event Definition

The first stage is to create an IA Event Definition for the incoming JIRA event payload. It contains the event structure required for the Event Engine to trigger Rules and execute processes (Jobs for example).

In this example, we are going to create an Event Definition with Attribute Keys based on a JIRA issue created event.

  1. Login into an Automation Engine Client where an IA Agent is assigned. See: Assigning Clients to Agents
  2. Create an IA Event Definition. Click Process Assembly in AWI. Then:

    • Click Add Object from the toolbar
    • Select and expand Variable tree
    • Select and expand XMLvariables, then select IA > EVENT_DEFINITION Variableto create the definition sheet
    • Name the IA Event Definition sheet JIRA.ISSUE.EVENT
  3. Add the Attribute Keys to the newly created JIRA.ISSUE.EVENT Event Definition. To do this, you need to know the content and structure of the received JIRA event payload.
    There are several ways to get this information:

    • Use JIRA webhook web pages to provide us with resources
    • Create or use an existing endpoint to make a test event payload

    Important! The JIRA event payload is based on the JSONPath structured schema. When populating the Event Definition Key Attributes column, the schema needs to be transformed into a flat structure.

    The following example shows how to translate the transform JSONPath structured data into a flat structure.

    The following example shows  how to transform your received JSONPath structured data to a flat structure.

    Note: Although there is no rule for naming Key Attributes, they have been named as they appear in the JSON. This enables you to map them easily when you create a Webhook Event.

    The following columns are populated:

    • Attribute Key
    • Description  
    • Type

    The information used to create the Event Definition is largely based on JIRA issue related fields, however you have also include user and event related fields.

    Here is the full list created in the Event Definition Attribute Key column:

    Create and Map the Webhook Event

    You have now created and populated JIRA.ISSUE.EVENT Event Definition. It's now possible to create a Webhook Event object in AWI.

    At this point you are creating an endpoint for JIRA to send event payloads to the Event Engine to be processed.

    1. In AWI, click Process Assembly.

      • Click Add Object from the toolbar
      • Select and expand Event (EVNT) tree
      • Select and expand IA variables, then select WEBHOOK Event
    2. In the Webhook Event we select JIRA.ISSUE.EVENT Event Definition from the drop-down list.

      Add Event Definition to Webhook Event object


    3. You now need to map all the Attribute Keys in the Event Definition sheet to the JSON path. The content and structure is already known in the JIRA event payload, as it helped you previously build the JIRA.ISSUE.EVENT Event Definition.

      Important! Always test your JSONPath expressions against the Event Engine before putting them into production. JSONPath Expressions created in external tools might not work as expected as there is no common JSONPath query syntax standard.

      Finally each Attribute Key is mapped to its corresponding JSONPath.

      In the following example, each Event Definition Attribute Key has been mapped to its equivalent JSONPath.

    4. To trigger a Rule in the Event Engine, create a conditional filter that is applied when an issue_created event is received.

      Using JIRA online information for the syntax, we create the following filter:

      $webhookEvent is equal to jira:issue_created.

      $webhookEvent is equal to jira:issue_created.

      Note: The filter operator table has the same operators as outlined in the Simple Rule.