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

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.



2 answers

1 accepted

1 vote

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.

Thanks Jobin,

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



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.

Looks like the indexes were broken!

Thanks, that's fixed it!


Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted yesterday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

84 views 2 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot