Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my alert status remain "open" when I fetch it immediately after receiving a "close alert" w

Abdelhadi Nasmane
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 31, 2025

Details:

  • I have configured a close alert Web hook in OpsGenie.

  • When I receive the Web hook, I immediately fetch the alert’s full data using the OpsGenie API. (because I need some info that doesn't appear in the Web hook)

  • However, the response still shows the alert status as "open" instead of "closed."

  • This happens even though the Web hook was triggered for a closed alert.

  • It seems like there’s a delay in updating the alert status in the API.

Steps I Followed:

  1. Configured a close alert Web hook.

  2. Received a Web hook when an alert was closed.

  3. Fetched alert details using the API immediately.

  4. The response still showed "status": "open" instead of "closed".

Questions for OpsGenie Team:

  1. Is there an internal delay between triggering the Webhook and updating the alert status in the API?

  2. Does OpsGenie guarantee that an alert's status is updated before the Web hook is sent?

  3. Would adding a delay before fetching the alert data ensure correctness?

  4. Is there an API parameter to force retrieving the most updated alert status?

1 answer

1 accepted

1 vote
Answer accepted
Shashwat Khare
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2025

Hi @Abdelhadi Nasmane ,

This is Shashwat and Opsgenie and here to help! :)

May I know if you have configured the Close alert action filter to look for specific field values in the incoming payload and auto-close the alert as explained in this help document?

Could you please help me with the close webhook payload being sent for this and a screenshot of the close alert action filter on the Opsgenie API integration level?

Best,
Shashwat

Abdelhadi Nasmane
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 1, 2025

Hi @Shashwat Khare 

The problem has been solved by waiting some time (2 seconds) before fetching the alert data (Or just keep fetching until you get a version with status: "close" since we are sure the alert was closed after receiving the close Alert webhook).

So I assume OpsGenie was sending the close Alert webhook, and needed some time before updating the alert fields, however since I was fetching the alert's info immediately after receiving the webhook I was getting an out dated version.

So the problem has been solved.

For your questions:

  • This is the webhook config:
    WebhookConfig.png
  • And for the webhook it looks like this:
{
"action": "Close",
"alert": {
"alertId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"message": "SOME_MESSAGE",
"tags": [
"tag1",
"tag1"
],
"tinyId": "xxxxx",
"entity": "cluster-name:namespace",
"alias": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"createdAt": 1743501745883,
"updatedAt": 1743505946816000000,
"username": "Alert API",
"description": "SOME_DESCRIPTION",
"responders": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "team",
"name": "TeamName"
}
],
"teams": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
"actions": [],
"details": {
"alertname": "SOME_MESSAGE"
},
"priority": "P4",
"oldPriority": "P4",
},
"source": {
"type": "Prometheus"
},
"integrationName": "SOME_INTEGRATION_NAME",
"integrationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"integrationType": "Webhook"
}


Thank you for your response. If you have a better solution please let me know.
Shashwat Khare
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2025

Hello @Abdelhadi Nasmane ,

Yes, this is the correct payload being used for the Close alert action on the Opsgenie side.

I'm glad you were able to implement the 2-second delay so that the async framework works as expected here.

Best,
Shashwat

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events