# Opsgenie

## Overview <a href="#overview" id="overview"></a>

Opsgenie (now acquired by Atlassian) is mainly used for for on-call, alerting, and incident management.

Opsgenie integration is intended for users who have Opsgenie set up as the primary alerting and on-call management system.

## Use Cases <a href="#use-cases" id="use-cases"></a>

The integration between Fylamynt and Opsgenie lets you:

* Trigger a workflow in Fylamynt, when a specific Opsgenie Alert goes into the state of ALERT.

## Configure Opsgenie in Fylamynt

* Navigate to **Settings** > **Integrations** > **Opsgenie**.
* Configure a new integration instance

Details needed to set up **Opsgenie instance** in **Fylamynt**:

| **Parameter**        | Description                                         | **Required** |
| -------------------- | --------------------------------------------------- | ------------ |
| Opsgenie API token   | API Token obtained from Opsgenie                    | True         |
| Webhook API Key Name | Fylamynt API Key name                               | True         |
| Opsgenie Webhook URL | Fylamynt webhook URL to be used by Opsgenie service | True         |

Webhook is used to **fetch alerts** from Opsgenie in real-time. You can also **Enable / Disable** Opsgenie Webhook.

Follow the steps listed below in your **Opsgenie Account** and get the desired parameters to enter in **Fylamynt**.

* In your Opsgenie Account, go to “**Teams”** --> “**Select your team”** --> “**Integrations”** --> “**Add Integration”**.
* Select **API** as an integration option.
* Give **read-only** access, copy API Key and **Save** **Integration.**
* Now need to configure webhook:
  * Select “**Teams”** --> **“Your Team”** --> “**Add Action Channel”**
  * Provide name for the Action Channel
  * Select **Rest Endpoint** as a type for Action Channel
  * Add following details:
    * **URL**: copy Webhook URL from the Opsgenie Webhook URL in the right side panel.
    * **Custom Headers:**
      * Name: x-api-key
      * Value: add "Webhook API Key value" from right side panel
    * Instructions to get Fylamynt " Webhook API Key value":
    * Under Authorize Fylamynt, choose one of the **Webhook API Key Name** from the dropdown, and the corresponding **Webhook API Key Value** should be shown. If no options are available for the **Webhook API Key Name**, first go to **Settings** --> A**PI Keys** --> Manage Keys to Create a New API Key.
* Create **Managed Action:**
  * Select **“Teams” --> “Action” --> “Add Action”**
  * Select “**REST Endpoint”** --> (previously created Action Channel) --> “**Next”** --> “**Create”**
* Create **Policy** for created **Managed action:**
  * Select “**Teams”** --> “**Policies”** --> “**Add Action Policy”**
  * Tick Enable policy when created, add conditions when you want to trigger Webhooks.
  * Then click on **Create and enable policy**

## Integration Actions <a href="#integration-actions" id="integration-actions"></a>

You can add these actions in the Fylamynt workflow builder, as part of your workflow.

1\. [Opsgenie Alert Trigger](#opsgenie-alert-trigger)

### **Opsgenie Alert Trigger**

The integration node triggers the automatic execution of a workflow from a selected **Opsgenie Service**.

When creating a workflow, you are presented with a wizard to select the trigger type to use.

* On the workflow page, select **New Workflow**
* Enter the name of the Workflow.
* Select the **Opsgenie** trigger type.
* Click **Create Workflow**
* ![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2F7nGI3IuZDHVlXSL9y8Pz%2Fimage.png?alt=media\&token=0bae66d9-2add-4217-bbd5-5a4d6d5c9031)

#### Configure the automatic execution of a workflow <a href="#fylamynt-task-management" id="fylamynt-task-management"></a>

To automatically run workflows with the Opsgenie Alert trigger, the incident type and assignment need to be configured. Follow the step-by-step instructions provided on the[ Incident Management - Automatic workflow execution](https://docs.fylamynt.com/getting-started-1/7.-incident-management-automatic-workflow-execution) page.
