# Configuring JSM Alerts to Receive alerts via webhooks

## Create the integration in JSM

1. Settings → Products → Jira Service Management → Integrations → Add integration
2. Select **API**\
   ![](/files/M0u1N1WdtKwWNOB3SawO)
3. Name the integration and select an assignee team\
   ![](/files/0stSphCpF08Uy4oVHQ44)
4. Copy the API key:<br>

   <figure><img src="/files/0AgC4e3Nm3ctqOvuztNX" alt=""><figcaption></figcaption></figure>

## Create the webhook in Email This Issue

1. Open Email This Issue → Administration → Webhooks → Add → Add custom webhook
2. Fill out the required details:
   1. Name: custom name
   2. Description
   3. Event: select the event you want to create the alert for (reference our [Alerting via Webhooks](/email-this-issue/administration/alerting-via-webhooks.md) article for the available event types).
   4. Service URL: `https://api.atlassian.com/jsm/ops/integration/v2/alerts`&#x20;
   5. API Token - paste the API key from step 3 above.
   6. Request Header: `Authorization: GenieKey $!token`&#x20;
   7. Request Body: a JSON-formatted message payload that contains [JSM parameters](https://developer.atlassian.com/cloud/jira/service-desk-ops/rest/v1/api-group-integration-events/#api-jsm-ops-integration-v2-alerts-post-request-body) with either hard-coded values or values from [our variables](https://docs.meta-inf.hu/email-this-issue/administration/alerting-via-webhooks/webhooks#webhook-variables).&#x20;

```
{
    "message": "$!message",
    "alias": "$!entity.type - $!entity.id",
    "description": "$!details",
    "tags": [
        "Critical"
    ],
    "details": {
        "Entity Name": "$!entity.name",
        "Entity Type": "$!entity.type",
        "Entity ID": "$!entity.id",
        "Entity Link": "$!entity.link",
        "Jira Base Url": "$!jiraBaseUrl",
        "Incident Timestamp": "$!timestamp"
    },
    "entity": "Email This Issue",
    "priority": "P1"
}
```

{% hint style="info" %}
In the above example we provide a lot of information in the details parameter, to see this in the alert itself, you need to edit the rule in JSM side to save the information to specific alert fields.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meta-inf.hu/email-this-issue/administration/alerting-via-webhooks/webhooks/opsgenie-configuration-to-receive-webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
