JQuery to select all tasks with a due date of the next Tuesday

David Allen September 10, 2020

How to write a JQuery to filter on due date EOB next Tuesday

4 answers

0 votes
Thomas Friedrich November 26, 2021

So what is the answer to get the next <weekday>?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2021

Depends on your settings, but 

startOfWeek(+2) 

is the sort of thing you're looking for.

0 votes
Guilhem Dupuy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 10, 2020

 

Hello,

You can use the JQL code similar to the following :

duedate <= endOfDay(X)

Where stands for the number of days between today and the target date. If you had to write it today (Friday 10) for next Tuesday for instance, X=4 (independently of your working calendar).

You can find more information about JQL using the following link :

https://www.atlassian.com/blog/jira-software/jql-the-most-flexible-way-to-search-jira-14 

 

Keep me informed if it helped or not,

Guilhem

David Allen September 14, 2020

This will be an on demand query.  If you run it on Monday 14th it will effectively give you for due date Tuesday 15th.  But if you run it on Wednesday 16th it will effectively give you the due date of Tuesday 22nd.  In otherwords, no matter where you are in the week, you will always be able to get the next tuesday.   I have not seen an if/else clause catered of on JQL, otherwise I think this would be more straightforward.

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 10, 2020

well maybe this would work for you?

duedate = endOfWeek("+3d")

the exact syntax depends on your end of week

more info on your situation might yield a different answer from me, e.g. is this a one time query or do you wish to run it on demand or a subscription or....

David Allen September 14, 2020

This will be an on demand query.  If you run it on Monday 14th it will effectively give you for due date Tuesday 15th.  But if you run it on Wednesday 16th it will effectively give you the due date of Tuesday 22nd.  I have not seen an if/else clause catered of on JQL, otherwise I think this would be more straightforward.  

I think in your solution this might not work for the Monday 14th case, it would not give you Tuesday 15th but Tuesday 22nd

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 10, 2020

I assume you mean JQL, not jquery.  Which is

due = <date of Tuesday>

David Allen September 14, 2020

Yes, you are right.  I meant JQL.  This will be ab on demand query.  If you run it on Monday 14th it will effectively give you for due date Tuesday 15th.  But if you run it on Wednesday 16th it will effectively give you the due date of Tuesday 22nd.  I have not seen an if/else clause catered of on JQL, otherwise I think this would be more straightforward.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2020

You can use relative numbers - "due = > -7d" for example, would find you everything with a due date from 7 days before the query was run.  Run today, everything past Monday 7th.  Run tomorrow, everything past Tuesday 8th, and so-on.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5.0
TAGS
AUG Leaders

Atlassian Community Events