Update Message or Description of the Alert automatically in Opsgenie when the same is updated on the Jira ticket

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

問題

It is not possible to update the summary or description of the Alert automatically in Opsgenie when the same is updated on the Jira ticket. This is expected behaviour as it is not a part of the integration (Jira Service Management Cloud / Jira Software Cloud).

The below mentioned workaround can help if you want to update the Opsgenie alert with the updated summary or description of the Jira ticket.

環境

Jira Service Management Cloud / Jira Software Cloud integrated with Opsgenie via the New Integration:

ソリューション

You can follow the approach mentioned below to configure the Automation rule in Jira to update the Alert message or description in Opsgenie.

  1. Create an API Key in Opsgenie for Authorization purposes.
    1. Navigate to Settings → API key management.
    2. Click on Add new API key
    3. Add a Name > Select the following option for Access rights:
      Read
      Create and update.
    4. Click on Add API key and copy it.

  2. Create an Automation Rule in Jira.
    1. Open the project that you have chosen while adding the Jira Service Management/Jira Software integration in Opsgenie.
    2. Navigate to Project Settings → Automation → Create Rule.
      1. Trigger: Select the Field Value Changed action
        1. Fields to monitor for: Summary and Description
        2. Change type: Any changes to the field value
        3. For: Edit issue, Transition issue and Assign issue
      2. New condition: IF/ELSE block - select smart value condition
          1. First value: {{fieldChange.fieldID}}
          2. 条件: イコール
          3. Second value: Summary
      3. New Action: search for Send web Request action
        1. Paste the below values accordingly:

          Web Request URL:  https://api.opsgenie.com/v2/alerts/{{issue.key}}/message?identifierType=alias
          Headers:
                            Authorization: 
          GenieKey <API Key from Step 1.d above>
                            Content-Type: 
          application/json
          HTTP method: 
          PUT
          Web request body: 
          Custom data
          Custom data: 

          {
          "message":"{{issue.summary}}"
          }
        2. Click Next.
      4. Add Else- repeat steps (2 b.ii to 2 b.iii) for description field. The complete rule should look as follows

注意:

You can import this automation rule in your cloud site using the file mentioned below. Once the import is completed, please add your API key from step 1.d above and save it.

References

  1. Opsgenie alert API
  2. Jira Automation Conditions
  3. Import automation rules to a Jira cloud site

If you encounter issues or require further clarification on the topic, please consider reaching out to Atlassian Support for further assistance.

最終更新日: 2024 年 2 月 27 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.