JQL query to get all tasks that will expire in X days

Lee Cash May 6, 2014

Hi guys,

I can assure you that this is a last resort. I've tried so many different permutations of JQL to achieve what I want and have searched endlessly to no avail.

I'm trying to do something very simple - get a list of JIRAs whose due date is X number of days from today's date.

I believe it's something along the lines of:

project = proj-name and due > "2d"

I can get all tasks that are past their due date by using:

project = proj-name and due < now()

That works, but whatever I use ("-2d", reverse the brackets, remove the quotes, whatever) in the first query I still get back JIRAs in my result set that are NOT due in 2 days. I'm getting JIRAs back that have due dates MONTHS into the future.

Any help would be appreciated.

Regards,

Lee

2 answers

2 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

How about this?

project = proj-name and due &gt; now() and due &lt; 2d

This will get you the issues due between now and 2 days from now.

Lee Cash May 6, 2014

Thanks Jobin,

Unfortunately this brings back no issues. I'm starting to think there is something wrong with my JIRA date settings ...

Regards,

Lee

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

I would increase the number of days from 2 to 10 just to make sure there are issues due in that time frame. Also try a full reindexing to check if the indexes are broken or not.

Also, make sure you have the standard due date populated and it is not any custom field.

0 votes
Lee Cash May 6, 2014

Looks like the indexes were broken!

Thanks, that's fixed it!

Lee

Suggest an answer

Log in or Sign up to answer