Hi everyone,
I am a newbie here. I am running Jira Server on-prem (version 7.6.4). I am trying to find all issues updated in the last hour with the URL below and it works fine.
/rest/api/2/search?jql=updated>=-1h
However, when I tried to find all issues within Jira Key "ZYX" that were updated within the last hour, it returned issues that were updated in 2019. What am I doing wrong?
/rest/api/2/search?jql=project=ZYX&updated>=-1h
Thanks in advance for your help!
Best!
Hi everyone,
I believe I got it figured out. In case anyone runs into the same issue, you could try
/rest/api/2/search?jql=project=ZYX%20AND%20%20updated>=-1h
This is how I got it to work. Thanks again for everyone's help!
Best,
Ben
Hi Benjamin Pea,
As per documentation says:
Use one of the following formats:
"yyyy/MM/dd HH:mm"
"yyyy-MM-dd HH:mm"
"yyyy/MM/dd"
"yyyy-MM-dd"
Or use"w"
(weeks),"d"
(days),"h"
(hours) or"m"
(minutes) to specify a date relative to the current time. The default is"m"
(minutes). Be sure to use quote-marks ("
); if you omit the quote-marks, the number you supply will be interpreted as milliseconds after epoch (1970-1-1).
So believe you must use the following URL instead:
/rest/api/2/search?jql=project=ZYX&updated>="-1h"
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jack,
Thanks for the quick response, it doesn't look like it's returning the expected response. I am still getting issues that were updated in January.
I even tried
/rest/api/2/search?jql=project=ZYX&updated>="2020-02-18" but still getting incorrect results.
Thanks again for your help. Hopefully you or someone else can figure out what I am doing wrong.
Best,
Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone,
I believe I got it figured out. In case anyone runs into the same issue, you could try
/rest/api/2/search?jql=project=ZYX%20AND%20%20updated>=-1h
This is how I got it to work. Thanks again for everyone's help!
Best,
Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OMG! How can I miss the AND operator while checking for your error.... :(
I didn't notice the typo on the JQL... Next time, to avoid this kind of problems, you better generate the JQL on the UI and the simply use the /rest/api/2/search endpoint to get the results over REST API once it works on Jira itself like this:
/rest/api/2/search?jql=<A WORKING JQL HERE>
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.