Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

OpsGenie Alerts API Integration

Devin McElheran
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!
May 5, 2023

Hi,

I'm writing some PowerShell for alerting purposes. I can create an alert. I can retrieve that alert using the alias, ID, and tiny ID, all working, so I know that my URLs are being encoded properly.

The problem is that I'm unable to close the alerts. I've tried a few different closure rules like `message contains "Resolve"` or `actions contains "Resolve"` to see if that would do the trick, but none seem to be working. I get the 202 "Request will be processed" response, which I understand is the default response when the request goes into the queue, but the alert doesn't close. I don't see anything coming up in the activity log for the alert, which would lead me to believe that the closure request isn't matching the alert.

If the URL encoding is right for getting alerts, it should be right for closing alerts. I'm using the PowerShell `Invoke-RestMethod` cmdlet, which takes care of encoding URLs. That would leave the URL content, which I've copied from the documentation, but that isn't producing any errors in the response for alias, ID, or tiny ID, leaving me assuming it's also right.

So, I'm kind of at a loss without any additional feedback. Is there a way to follow up on the requestId that's returned after submitting the closure request?

Thanks,

Devin

1 answer

0 votes
Shashwat Khare
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2023

Hey @Devin McElheran ,

Thank you for elaborating on the issue in such detail :) 

From the above description, it looks like the Close Alert action filter is not processing the alert closure as per the filter setup, as you have rightly mentioned.

To effectively investigate why the alerts are not closing, could you please log a support ticket with us using the link below:
https://support.atlassian.com/contact/#/

We will investigate a sample Alert's audit log to understand why the action filter isn't working on them.

Best,
Shashwat

Devin McElheran
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!
May 8, 2023

Hi @Shashwat Khare

I ended up figuring it out, sort of. The alert would not close based on any criteria I configured, so I removed the configuration altogether and created a new one that matches all. That fixed it for me. Given that I have closure logic on the other end, I'm not too concerned given that it's the API and not just an email alert.

Thank you for your assistance.

Like Shashwat Khare likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events