How to integrate Jira via Webhooks?
Jira can be a great tool for tracking progress and resolution of issues. This section describes how to send Arthur alert webhook to a Jira project, to create issues whenever an alert is fired. More information on Jira automations with
incoming webhooks can be found here.
Create Jira Automation
In Jira, navigate to your project, then "Project settings", then "Automation". From here, click "Create rule". Next,
select "Incoming webhook" from the list of available triggers.

Next, note the Webhook URL for setting in Arthur later. Also, be sure to select "No issues from the webhook" on the
radio buttons. Click "Next".
Select "THEN: Add an action". Under the search bar, select "All actions" and type "create".
Select the "Create issue" action. The form should look like the following:

Choose a project, issue type and then enter the following:
- Summary -
Arthur Alert: Metric {{webhookData.metric_name}} had value {{webhookData.value}} outside threshold {{webhookData.bound}} {{webhookData.threshold}}
- Description - enter the following text, be sure to replace <ARTHUR_URL> with the hostname of your Arthur instance
View the alerts here: https://<ARTHUR_URL>/models/{{webhookData.model_id}}/alerts
Click "Next". Click "Turn on rule" and give the rule a useful name. Lastly make sure the rule is Enabled.
Create the webhook in Arthur
Follow the steps in creating a webhook above to navigate to the webhook creation form. Once
there, enter the following information:
- URL - enter the Jira Webhook URL obtained in step 1
- Headers - Name Content-type and Value application/json
- Body - enter the following JSON
{
"data": {
"model_name": "{{model.name}}",
"model_id": "{{model.id}}",
"number_of_alerts": {{alerts|length}},
"metric_name": "{{alerts[0].alert_rule_metric_name}}",
"description": "{{alerts[0].description}}",
"threshold": "{{alerts[0].threshold}}",
"bound": "{{alerts[0].bound}}",
"value": "{{alerts[0].value}}"
}
}
Test the webhook
Next, click "TEST WEBHOOK" to attempt to send an example event to the Jira Webhook. Note, this sample will be populated with dummy IDs, so the link will not link to an actual model. When a real alert triggers after saving the webhook, the IDs will be real, so the link will work as expected.
If everything works as expected, there should be a SUCCESS event under the Jira rule's Audit log:

And lastly, there should be a new issue in your project backlog with the contents of the alert information.

Updated 30 days ago