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

  1. 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.
    1. Generate a 1024-bit private key:
      openssl genrsa -out jira_privatekey.pem 1024
    2. Create an X509 certificate:
      openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365
    3. Decompress the private key (PKCS8 format) to the jira_privatekey.pcks8 file:
      openssl pkcs8 -topk8 -nocrypt -in jira_privatekey.pem -out jira_privatekey.pcks8
    4. Extract the public key from the certificate into the jira_publickey.pem file:
      openssl x509 -pubkey -noout -in jira_publickey.cer  > jira_publickey.pem
  2. Create an application link.
    1. Log on to Jira, click the Settings icon in the upper-right corner of the Jira page, and then click Applications.
      Jira applications
    2. On the Applications tab, click Application links.
    3. 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/.
    4. In the Configure Application URL dialog box, ignore the warning and click Continue.
      Configure Application URL
    5. 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.
      Link Applications
    6. 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.
      Link application-02
      After a while, you can view the new application link on the Configure Application Links page. Configure Application Links
    7. Click the Pencil icon in the Actions column of the application link. In the Configure alertmanager dialog box, click Incoming Authentication.
      configure alertmanager
    8. If the Status parameter displays Not Configured, specify Consumer Key, Consumer Name, and Public Key, and then click Save.
    9. Click Cancel.

Step 2: Integrate Jira with ARMS

  1. Log on to the ARMS console. In the left-side navigation pane, choose Alert Management > Integrations.
  2. On the Integrations page, click the Notification Integration tab and then click JIRA.
  3. In the Add Integration wizard, configure the parameters based on the following information:
    1. 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.
    2. On the Welcome to JIRA page, click Allow.
      Welcome to Jira
    3. On the Access Approved page, obtain the verification code.
      Access Approved
    4. 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.
      Obtain an access token
    5. After the message The access token is obtained. is displayed, click Next.
    6. 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. Jira integration

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.

  1. In the left-side navigation pane, choose Alert Management > Notification policy.
  2. On the Notification policy page, click Create Notification Policy or edit an existing notification policy.
  3. 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.
  4. 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.
  5. After the configuration is complete, click the Check 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.

  1. In the left-side navigation pane, choose Alert Management > Alarm Sending History.
  2. 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.
  3. On the details page of the alert, click the More icon in the upper-right corner, and then click Push to Ticket System.
  4. 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

  1. On the Integration page in ARMS, click the Ticket Integration tab to obtain the integration key of Jira.
    Integration key of Jira
  2. Log on to Jira, click the Settings icon in the upper-right corner of the Jira page, and then click System.
    Jira settings
  3. Enter the password of the administrator and click OK to go to the System page.
  4. On the System page, choose Advanced > WebHooks in the left-side navigation pane.
  5. On the WebHooks page, click + Create a WebHook.
    Create a webhook in Jira
  6. 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.
    Create a webhook in Jira
  7. 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.