Querying alerts by date

Dries Melkebeke
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!
January 27, 2025

Hi,

I'm trying to query alerts by a date including a hour, minute and second timestamp. 

Following query returns 1 alert object, which is expected:

https://api.eu.opsgenie.com/v2/alerts?query=createdAt>26-01-2025

Following query returns a empty array:

https://api.eu.opsgenie.com/v2/alerts?query=createdAt>26-01-2025'T'00:00:00

{ "data": [], "paging": {}, "took": 0.01, "requestId": "1b9fd7c6-ce1e-425a-a486-0b9d4e7affaa" }

Am I doing something wrong? According to below error message I'm following the time formatting correctly:

{ "message": "Time is accepted in following formats: [dd-MM-yyyy] - [dd-MM-yyyy'T'hh:mm:ss] - [dd-MM-yyyy'T'HH:mm:ssz]", "took": 0.0, "requestId": "d236e633-7195-45c0-a9d3-228ba9df3334" }

 Thanks

1 answer

1 accepted

2 votes
Answer accepted
Abhay Sarraf
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2025

Hey Dries,

Hope you're doing well.

The datetime value has to be within double quotes.

You can try -> query=createdAt>"15-10-2024T00:00:00Z"

 

Hope that helps :) 

Dries Melkebeke
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!
January 29, 2025

Thanks, that solved my issue! 

Like Abhay Sarraf likes this

Suggest an answer

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

Atlassian Community Events