It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Substract dates in JQL

I'm trying to create a filter that does the following:

Return all issues where the due date is 2 weeks less than the current date, or lower.

But I'm stuck trying to substract to achieve something like this:

now() + 2w > duedate

But that obviously doesn't work. Any elegant alternative for this?

3 answers

1 accepted

2 votes
Answer accepted

try following: 

duedate < startofday("+2w")

 

have not tried now("+2w") but may be is is working as well

Thanks! This pointed me in the right direction, and the filter I require is:

duedate > startOfDay("-2w")

Actually, this is not quite what I want. The filter would not include all the desired issues. The correct filter would be:

startOfDay() >= duedate("-2w")

But unfortunately, this doesn't work...

so you want all issues that have the duedate in 2w from now, or? Try: duedate >= startOfDay("+2w") and duedate <=startofday("+15d")

It's difficult to put this into words. Say you have an issue, and the current date is "01/09/2014". The due date is "15/09/2014". The issue should be in the filter. But it should also be in the filter when the current date is "16/09/2014". But it should NOT be in the filter if the current date is "15/08/2014". I hope you understand what I'm trying to achieve.

So all issues with duedate in 14 days or less or duedate is passed, correct?

Yes, exactly.I was thinking this should work, but it still includes issues where the due date is higher than the current date + 2 weeks: (duedate > startOfDay("-2w") OR duedate < startOfDay())

Like 1 person likes this

so it should be duedate < startofday("+15d")

That's it! Thanks, I was obviously over complicating this...

glad I could help

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 09, 2019 in Portfolio for Jira

Portfolio for Jira 3.0 is here!

The wait is over... Portfolio for Jira Server and Data Center 3.0 is now officially here! Platform releases offer Atlassian an opportunity to shift our strategy, make bold predictions about t...

1,382 views 14 26
Read article

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