Automatically create Jira Issue from Datadog alert
This guide demonstrates how to implement an automated process in Port that creates a Jira issue from a Datadog alert.
This automation streamlines prompt incident resolution and improves overall platform reliability.
Use cases
- Automatically create Jira issues from Datadog alerts.
- Track and follow up on incidents from monitoring systems.
Prerequisites
- Complete the onboarding process.
- Access to your Jira organization with permissions to create issues.
- Port's Datadog integration needs to be installed.
- Jira API token with permissions to create new issues.
Set up data model
For this guide, we will use the data model provided by the Port Datadog integration.
If you haven’t installed the Datadog integration yet, head over to the integration installation page to install it. This will automatically set up the relevant blueprints for you.
Set up automation
With the integration installed and Datadog alerts ingested into Port, we’ll now set up an automation that is triggered when a Datadog Alert
priority changes to high or critical. Alert priorities in Datadog are indicated by integer values from 1 (critical) to 5 (low). This automation will create a Jira issue using the details of the alert.
Follow the steps below to configure the automation:
Add Port secrets
To add these secrets to your portal:
-
Click on the
...
button in the top right corner of your Port application. -
Click on Credentials.
-
Click on the
Secrets
tab. -
Click on
+ Secret
and add the following secret:-
JIRA_AUTH
- Base64 encoded string of your Jira credentials. Generate this by running:echo -n "your-email@domain.com:your-api-token" | base64
Replace
your-email@domain.com
with your Jira email andyour-api-token
with your Jira API token.One time generationThe base64 encoded string only needs to be generated once and will work for all webhook calls until you change your API token.
-
Automation backend
-
Head to the automation page.
-
Click on the
+ Automation
button. -
Copy and paste the following JSON configuration into the editor:
Create Jira issue from Datadog alert automation (Click to expand)
Placeholde replacementReplace
<JIRA_ORGANIZATION_URL>
in the webhook URL with your Jira organization URL (e.g.,example.atlassian.net
).Replace
<JIRA_PROJECT_NAME>
in the webhook body with your Jira project name.{
"identifier": "createJiraIssueFromDatadogAlert",
"title": "Create Jira Issue from Datadog Alert",
"description": "Automation to open a Jira issue when a Datadog alert changes from medium to higher priority",
"trigger": {
"type": "automation",
"event": {
"type": "ENTITY_UPDATED",
"blueprintIdentifier": "datadogMonitor"
},
"condition": {
"type": "JQ",
"expressions": [
".diff.before.properties.priority | tonumber >= 3",
".diff.after.properties.priority | tonumber < 3"
],
"combinator": "and"
}
},
"invocationMethod": {
"type": "WEBHOOK",
"url": "https://<JIRA_ORGANIZATION_URL>/rest/api/3/issue",
"agent": false,
"synchronized": true,
"method": "POST",
"headers": {
"Authorization": "Basic {{.secrets.JIRA_AUTH}}",
"Content-Type": "application/json"
},
"body": {
"fields": {
"project": {
"key": "<JIRA_PROJECT_NAME>"
},
"summary": "Datadog Alert: {{.event.diff.after.title}}",
"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Priority",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.priority}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Monitory Type",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.monitorType}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Overall State",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.overallState}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thresholds",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.thresholds}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Tags",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.tags}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Created By",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.createdBy}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Created At",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.createdAt}}"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Updated At",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": ": {{.event.diff.after.properties.updatedAt}}"
}
]
}
]
},
"issuetype": {
"name": "Bug"
},
"labels": [
"datadog"
]
}
}
},
"publish": true
} -
Click
Save
.
Now, every time a Datadog Alert
priority is raised to high or critical (i.e., moves from 3, 4, or 5 to 1 or 2), a Jira issue like the one below will be created:
