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

How to use opsgenie api to get alert list between a datetime range

gnaneswar seshu
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!
August 22, 2024

Hi,

I was trying to get alerts between a period of time, when I used the query as ""

query": "createdAt>=20-08-2024 and createdAt<=22-08-2024" it is giving me some list of alerts but when I was trying the query including time within it for example ""
query": "createdAt>=20-08-2024'T'10:30:00z and createdAt<=22-08-2024'T'18:30:00z I am not getting any alerts while I can see alerts from ui or app
here is the sample url which is working:

1 answer

0 votes
Wei Wung
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2024

Hi @gnaneswar seshu 

Thank you for reaching out! 

Please try using this format: 

createdAt>="20-08-2024T10:30:00Z" and createdAt<="22-08-2024T18:30:00Z"

The workaround in the following ticket addressed this issue as well:

https://jira.atlassian.com/browse/OPSGENIE-1588  Incident API and Alert API using the "createdAt" condition display incorrect usage error

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events