You can integrate Jira with the alert management feature of Application Real-Time Monitoring Service (ARMS) by using a Jira account or Open Authorization (OAuth). This topic describes how to integrate Jira with alert management of ARMS by using OAuth. This way, an issue is created in Jira when an alert is generated in ARMS. The alert status and the issue status can be synchronized.
Step 1: Configure Jira
Run the following OpenSSL commands at the command-line interface (CLI) to generate a Rivest–Shamir–Adleman (RSA) public key and an RSA private key.
NoteYou can run these commands in any directory. The generated files are saved to the current directory.
Generate a 1024-bit private key:
openssl genrsa -out jira_privatekey.pem 1024Create an X509 certificate:
openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365Extract the private key in PKCS#8 format to the jira_privatekey.pcks8 file.
openssl pkcs8 -topk8 -nocrypt -in jira_privatekey.pem -out jira_privatekey.pcks8Extract the public key from the certificate into the jira_publickey.pem file:
openssl x509 -pubkey -noout -in jira_publickey.cer > jira_publickey.pem
Create an application link.
Log on to Jira, click the Settings icon in the upper-right corner of the Jira page, and then click Applications.
On the Applications tab, click Application links.
In the Configure Application Links section, enter a URL and click Create new link.
NoteThis URL is arbitrary and does not affect the integration. You can enter any URL, such as
http://alerts.console.aliyun.com/.In the Configure Application URL dialog box that appears, ignore the warning and click Continue.
In the dialog box, the Entered URL is displayed as
http://alerts.console.aliyun.com/, and the New URL is automatically changed tohttps://alerts.console.aliyun.com/.In the Link applications dialog box that appears, set Application Type to Generic Application, enter AlertOauthKey for consumer key, select the create incoming link checkbox, fill in any other parameters as needed, and then click Continue.
In the Link applications dialog box, configure the following parameters and click Continue.
Parameter
Value
Consumer Key
AlertOauthKey
Consumer Name
alertmanager
Public Key
The content of the jira_publickey.pem file generated in Step 1.
In the Target Application section of the Link applications dialog box, set Application URL to
https://alerts.console.aliyun.com/, configure the preceding parameters, and then click Continue.After a moment, the new application link appears on the Configure Application Links page. The application list shows that alertmanager has been successfully added as a Generic Application type with the status NON-ATLASSIAN.
In the Action column for the application link, click the edit icon (
). In the Configure alertmanager dialog box, click incoming authentication in the left-side panel.If the Status is Not Configured, re-enter the consumer key, Consumer Name, and public key, and then click Save.
Click Close.
Step 2: Integrate Jira with ARMS
-
Log on to the ARMS console. In the left-side navigation pane, choose .
On the Integrations page, click the Notification Integration tab, and then click Jira.
In the Add Integration wizard, complete the following steps.
On the Basic Information page, configure the following parameters and click Obtain Verification Code.
You are redirected to the Jira authorization page.
Parameter
Value
Name
Enter a name for the Jira integration.
Description
Enter a description for the Jira integration.
URL
The URL of your Jira instance.
Verification
Set Authentication method to OAuth.
Consumer key
AlertOauthKey
Private key
The content of the jira_privatekey.pcks8 file generated in Step 1.
On the Welcome to Jira page, click Allow.
On the Access Approved page, obtain the verification code.
Return to the Add Integration wizard in the ARMS console. Paste the code into the Verification Code field and click Obtain Access Token.
When Obtaining Access Token Succeeded is displayed, click Next.
On the Alert Source Configuration page, configure the alert synchronization settings and click Save.
Parameter
Description
Example
Project
The Jira project where issues are created when an alert is triggered.
Integrated monitoring, management, and control project
Type
The Jira issue type for the alert.
Task
Subtask
Improvement
New feature
Bug
Epic
Story
Bug
Issue closed status
The status that marks a Jira issue as closed. Once an issue reaches this status, subsequent alert operations are no longer synchronized to it. Available statuses:
To Do
In Progress
In Review
Done
NoteWe recommend that you select Done. If you select a different status, alert operations will still be synced to the corresponding Jira issue even after its status changes to Done.
Done
Priority
Maps alert severity levels to Jira issue priorities.
ImportantIf you do not configure a mapping for an alert severity level, alerts of that level will not be synced to Jira.
The alert's severity level is synchronized based on this mapping only when it is first pushed to Jira. Subsequent changes to the alert severity level in ARMS Alert Management are not synchronized to the Jira issue.
P1: Hightest
P2: High
P3: Medium
P4: Low
P5: Lowest
After you save the configuration, you can view the new Jira integration on the Notification Integration tab. The list displays information such as the Name, Integration key, Type, and Creation time. You can manage the integration from the Actions column.
Push alerts to Jira
After configuring the Jira integration, you can push alerts to Jira in three ways:
Method 1
Set up a notification policy to automatically create an issue in Jira when an alert is triggered.
In the left-side navigation pane, choose .
On the Notification Policies page, click Create Notification Policy or edit an existing notification policy.
In the When an alert is triggered, section, specify the Contacts. You must select at least one contact or contact group.
ImportantJira assigns the issue to a user whose email address or username matches that of the first contact in the notification policy.
If the first contact in the notification policy does not have a corresponding user in Jira, the alert will not be synced to Jira.
For Ticket system, select the Jira integration that you created. Configure other parameters as required. For more information, see Notification policies.
Click Save.
After you complete the configuration, alerts that match this notification policy are pushed to Jira.
Method 2
From the Alert Sending History page, you can manually push an existing alert to Jira to create an issue.
In the left-side navigation pane, choose .
On the Alert Sending History page, select an operator in the upper-right corner to act as the Jira issue handler, and then click the name of the target alert.
ImportantJira assigns the issue to a user whose email address or username matches that of the selected operator.
If the operator does not have a corresponding user in Jira, the alert cannot be synced to Jira.
On the alert details page, click the
icon in the upper-right corner, and then click Push Alerts.In the dialog box that appears, for Ticket system, select the Jira integration you created and click Confirm.
After the alert is pushed successfully, a link to the corresponding Jira issue, such as AL-6, appears on the alert details page.
Method 3
When you receive an alert card in a DingTalk group, you can push the corresponding alert to Jira directly from the card.
The user who pushes the alert from the DingTalk group becomes the issue handler in Jira.
The operator must be a contact who has bound their mobile number in the alert card in the DingTalk group. For more information, see Handle alerts.
If a Jira user's email or username matches the email or name of an ARMS contact, the contact is mapped to that Jira user.
If the operator does not have a corresponding user in Jira, the alert cannot be synced to Jira.
On the alert card you receive in the DingTalk group, click Push Alerts and select the Jira integration that you created.
On the alert card, click the alert name. In the alert details panel, click Settings, click Push ticket, and select the Jira integration that you created.
After the alert is pushed successfully, a link to the corresponding Jira issue appears on the alert details page.
Supported alert operations for synchronization
Once configured, the following alert operations in ARMS Alert Management are synchronized with the Jira ticket system.
Operations on the Alert Sending History page:
Claim alert: Updates the Jira issue handler.
NoteThe user who claims the alert must have a corresponding user account in Jira.
Comment on alert: Adds the comment to the Jira issue.
Resolve alert: Adds the resolution as a comment to the Jira issue.
Operations on the alert card in a DingTalk group:
Claim alert: Updates the Jira issue handler.
The user who claims the alert must have a corresponding user account in Jira.
Sync Jira actions back to ARMS
In ARMS Alert Management, navigate to the Integrations page, click the Notification Integration tab, and copy the integration key for your Jira integration.
Log on to your Jira ticket system. In the upper-right corner of the Jira page, click the settings icon, and then click OsType.
Enter your administrator password and click Confirm to go to the system configuration page.
In the left-side navigation pane of the OsType page, choose .
On the Webhooks page, click + Create a webhook.
On the Create a webhook page, set the URL to
http://alerts.aliyuncs.com/api/jira/receiver/{token}/${project.key}/${issue.key}. Replace {token} with the Jira integration key from Step 1.Set Name to
ARMS Alert Managementand change the Status to Enabled. In the Issue related events section, select All issues. Under the Issue column, select created, updated, and deleted. Under the Comment column, select created, updated, and deleted.Configure other parameters as required. For more information, see the official Jira documentation. Then, click Create .
After completing these steps, the following Jira issue operations are synchronized with ARMS Alert Management.
Changing the issue handler: The handler of the corresponding alert is updated.
Adding a comment to an issue: A comment is added to the corresponding alert.