How to close Opsgenie alert when corresponding Incident issue is resolved or closed in JSM
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
This article will illustrate how to close the Opsgenie alert when the corresponding issue is resolved or closed in Jira. At the moment Jira doesn't send any information to Opsgenie in case the "issue closed" event is fired.
Configure an Automation rule
Please follow the steps below to build the solution. In the following example, the rule is being applied to Incident issue-type issues raised by creating an alert in Opsgenie.
Step 1: Configuration in Jira
Create an automation rule to add an internal comment on the closed issue:
Create an automation rule in which will add an internal comment to the issue when the issue transitions to the necessary status you're concerned with (e.g. Resolved / Cancelled / Closed / etc).
In the following Automation rule, I add an internal comment of "close alert" to the issue when the issue transitions to a completed state:
Once this has been created and is enabled, give it a quick test with a relevant test issue to make sure this part works.
Step 2: Configuration in Opsgenie
In Opsgenie we will be updating the respective integration to update the "Close Alert" action with a condition of where "commentBody" equals (or contains) the string "close alert" (Note: double quotes used here are not necessary for inclusion).
There are two main type of integrations with Jira Service Management, as shown in the following screenshot:
If using the “JIRA Service Management (NEW)” integration:
Modify the "incoming automation rules" to close alert when commentBody contains the string "close alert":
If using the "JIRA Service Management Cloud (Legacy)" integration:
Update the "Close Alert" action to include the condition of where "commentBody" equals (or contains) the string "close alert" (Note: double quotes used here are not necessary for inclusion):