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

How to get list of all alerts that were acknowledged by a user (given multiple acknowledgements)?

Jack Ford
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!
October 25, 2023

Using the OpsGenie REST API, how can I get a list of alerts acknowledged by a user (regardless of whether or not they were first to acknowledge it)? Currently, the 'acknowledgedBy' query param field doesn't seem to keep track of all users that acknowledged an alert. Instead, it only keeps track of one (it seems like whoever is the first to acknowledge it, but I'm not sure). 

Consider the following example: User A acknowledges alert X, and then a few hours later our on-call schedule shift changes, so then alert X is unassigned from User A and it is alerted to User B, at which point User B acknowledges it.

I want to be able to individually query all of the alerts acknowledged by each of these users (A and B) via API and have the above example alert X show up in the list of acknowledged alerts for both User A and User B since each of them acknowledged this alert (regardless of whether or not they closed it- acknowledgement is all that matters to me in this case).

In the context of the above example, I have tried using the following query param (assuming User B's email is userB@mail.com):

acknowledgedBy = "userB@mail.com"

But this does not necessarily return alert X in the results as multiple acknowledgements don't seem to be tracked per alert, as mentioned above in my problem statement.

The recipient and owner fields also do not seem to help here since they are just singular strings too, as documented here.

I have searched through lots of documentation and community posts and cannot find a solution for this use case issue. How can this desired result be achieved with the API?

1 answer

0 votes
Arumugam M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2023

Hey @Jack Ford 

Thank you for posing your question. I'm Arumugam from Atlassian Support and happy to help.

I understand you'd like to compile a list of all alerts acknowledged by a user, even if the action was subsequently reversed.

Regrettably, it's not possible to query these values using the List API, as only the most recent values can be used as a search parameter.

In this scenario, you might want to use the List API to gather a list of acknowledged alerts, and then use the Activity Log endpoint to capture all events linked to those alerts.

If an alert was acknowledged and then reverted back to open status, you can use the logs API to record all related events. You can then compile or save user and alert IDs or other information for further analysis.

Here is a screenshot for your reference:

2023-10-27_18-29-58.png

I hope this helps. Please let me know if you have any other questions. 

Thanks, 

Arumugam

Suggest an answer

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

Atlassian Community Events