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.
Note You can perform this operation anywhere in the file system, and the file that is created
is saved in the current location.
- Generate a 1024-bit private key:
openssl genrsa -out jira_privatekey.pem 1024
- Create an X509 certificate:
openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365
- Decompress the private key (PKCS8 format) to the jira_privatekey.pcks8 file:
openssl pkcs8 -topk8 -nocrypt -in jira_privatekey.pem -out jira_privatekey.pcks8
- Extract 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.
Note The URL is not used. You can enter a random URL, for example, http://alerts.console.aliyun.com/
.
- In the Configure Application URL dialog box, ignore the warning and click Continue.
- In the Link applications dialog box, set Application Type to Generic Application, set Consumer key to AlertOauthKey, select Create incoming link, specify other parameters, 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 public key generated in Step 1, which is the content of the jira_publickey.pem file.
|
After a while, you can view the new application link on the
Configure Application Links page.
- Click the icon in the Actions column of the application link. In the Configure alertmanager dialog box, click Incoming Authentication.
- If the Status parameter displays Not Configured, specify Consumer Key, Consumer Name, and Public Key, and then click Save.
- Click Cancel.
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, configure the parameters based on the following information:
- On the Basic Information wizard page, set the following parameters and click Obtain Verification Code.
You are automatically redirected to the verification page of Jira.
Parameter |
Value |
Name |
The name of the Jira integration. |
Description |
The description of the Jira integration. |
URL |
The URL that is provided by Jira. |
Verification |
Set Verification to Oauth.
|
Consumer key |
AlertOauthKey |
Private key |
The private key that is generated in Step 1, which is the content of the jira_privatekey.pcks8 file.
|
- On the Welcome to JIRA page, click Allow.
- On the Access Approved page, obtain the verification code.
- Return to the Add integration wizard page, enter the verification code that is obtained for the Verification Code parameter, and then click Obtain Access Token.
- After the message The access token is obtained. is displayed, click Next.
- On the Alert Source Configuration wizard page, set the following parameters and click Save.
Parameter |
Description |
Example |
Project |
Specify the Jira project to which the information about alerts is synchronized. |
Integrated monitoring, management, and control project |
Type |
The issue type in Jira.
- Task
- Subtask
- Improvement
- New feature
- Bug
- Epic
- Story
|
Bug |
The status of the issue when the alert is disabled. |
The status of Jira issues when the issues are resolved. When a Jira issue is in the
specified state, the Jira issue is identified as resolved. Operations on the alert
that corresponds to the issue are not synchronized to the issue. Valid values:
- To Do
- In Progress
- In Review
- Done
Note We recommend that you select Done. If you select another value and the status of an issue changes to Done, operations
on the alert that corresponds to the issue are still synchronized to the issue.
|
Done |
Priority |
The mappings between alert severity levels and issue priorities in Jira.
Important
- If an alert severity level is not mapped to an issue priority, alerts of this severity
level are not synchronized to Jira.
- When an alert is pushed to Jira for the first time, the severity level is synchronized
based on the mapping that you configure. After the severity level is synchronized,
if you modify only the severity level, the information about the modification is not
synchronized to Jira.
|
- P1: Highest
- P2: High
- P3: Medium
- P4: Low
- P5: Lowest
|
After the configuration is complete, you can view the Jira integration on the
Ticket Integration tab of the
Integration page.
Push alerts to Jira
After you add the Jira integration, you can push alerts to Jira by using one of the
following three methods:
Method 1
Configure a notification policy that creates an issue in Jira when an alert is generated.
- In the left-side navigation pane, choose .
- On the Notification policy page, click Create Notification Policy or edit an existing notification policy.
- In the When an alert is triggered, section on the edit page, specify the Contacts parameter. You must select at least one contact or contact group.
Important
- Jira searches for the user that has the same email address or name (username) as the
first contact that is specified in the notification policy, and sets the user as the
assignee of the issue that is created.
- If Jira cannot find the user that matches the first contact that is specified in the
notification policy, the alert is not pushed to Jira.
- Select the Jira integration that you created for the Ticket system parameter. Configure the other parameters as required. For more information, see
Create and manage a notification policy.
- After the configuration is complete, click the icon in the upper-right corner.
This way, the alerts that match the notification policy are pushed to Jira.
Method 2
On the Alert Sending History page, push alerts to Jira and create issues in Jira.
- In the left-side navigation pane, choose .
- In the upper-right corner of the Alarm Sending History page, select the operator and click the name of the alert that you want to manage.
The operator will be the assignee of the issue in Jira.
Important
- The operator is a contact whose mobile phone number is associated with the alert cards
of a DingTalk group. For more information, see Handle alerts.
- Jira searches for the user that has the same email address or name (username) as the
operator, and sets the user as the assignee of the issue that is created.
- If Jira cannot find a matching user, the alert is not pushed to Jira.
- On the details page of the alert, click the icon in the upper-right corner, and then click Push to Ticket System.
- In the Push Alert to Ticket System dialog box, select the Jira integration from the Ticket System drop-down list and click OK.
After the alert is pushed, you can find the link of the Jira issue on the details
page of the alert.
Method 3
After an alert is generated and an alert card is received in the DingTalk group that
you specify, you can use the alert card to push the alert to Jira. Then, a corresponding
issue is created in Jira.
Important
- The operator who pushes the alert will be the assignee of the issue that is created
in Jira.
- The operator is a contact whose mobile phone number is associated with the alert cards
of a DingTalk group. For more information, see Handle alerts.
- If Jira finds a user who has the same email address or username as the contact that
you specify in ARMS, the contact matches the user in Jira.
- If Jira cannot find a matching user, the alert is not pushed to Jira.
- In the alert card that you receive, click Push Alert, and then select the Jira integration that you created.
- Click the name of the alert on the alert card. In the details panel of the alert,
click Settings, click Push Ticket, and then select the Jira integration that you created.
After the alert is pushed, you can find the link of the Jira issue on the details
page of the alert.
Alerts-related operations that can be synchronized
After you complete the preceding steps, the following operations on alerts in ARMS
are synchronized to Jira.
The following operations on the Alarm Sending History page are synchronized to Jira:
- Claim an alert: The claimant will be the assignee of the issue in Jira.
Note The claimant must have a matching user account in Jira.
- Comment on an alert: The comment is synchronized to the comment of the issue in Jira.
- Resolve an alert: The solution is synchronized to the comment of the issue in Jira.
The following operation on the alert card is synchronized to Jira:
Claim an alert: The claimant will be the assignee of the issue in Jira.
Note The claimant must have a matching user account in Jira.
Synchronize Jira operations to alerts
- On the Integration page in ARMS, click the Ticket Integration tab to obtain the integration key of Jira.
- Log on to Jira, click the Settings icon in the upper-right corner of the Jira page,
and then click System.
- Enter the password of the administrator and click OK to go to the System page.
- On the System page, choose in the left-side navigation pane.
- On the WebHooks page, click + Create a WebHook.
- On the page that appears, set URL to
http://alerts.console.aliyun.com/api/jira/receiver/{token}/${project.key}/${issue.key}
. {token} is the integration key that is obtained in Step 1.
- Set other parameters as required. For more information, see the Jira documentation. Then, click Create.
After you complete the preceding steps, the following operations on an issue in Jira
are synchronized to alert management of ARMS.
- Modify the assignee of an issue: The handler of the corresponding alert is modified.
- Comment on an issue: The comment is added to the comment of the corresponding alert.