2

How do I create a JQL query, for a JIRA Agile swimlane, that displays all tasks due on the closest Wednesday in the future. For example, today is Monday and I want to see all tasks due on Wednesday (in two days). If today is Thursday, I want to see all tasks due on Wednesday next week.

One solution I have found it to use the following query, but it forces the due date to always be set on a Wednesday:

duedate <= 6d

I have also tried something with endOfWeek, but is only works in my Monday example and not in my Thursday example.

duedate <= endOfWeek(-3d)
JeredM
  • 897
  • 1
  • 14
  • 25

2 Answers2

1

I think it is not possible just with JQL. Can you use scripts? or plugins? do you have scriptrunner plugin installed??

  • If you can get scriptrunner: there is a feature, Scripted field: you could add a scripted field always hidden wich calculate the next wednesday. So then you JQL could be just duedate<=wednesday

  • If not your best choice would be use two querys. One for days before wednesdays, and another one for days after

For days before wednesday:

duedate <= startOfWeek(3d) and duedate > startOfWeek()

For days after wednesday:

duedate <= startOfWeek(10d) and duedate > startOfWeek(7d)

Sadly i cant test it properly, but it should work (if your country locale is USA based as i guess due to your profile :) )

Regards.

Oldskultxo
  • 945
  • 8
  • 19
  • We decided to go with the duedate <= 6d solution for now and have the due dates assigned on the Wednesday. If this works out, we will use the script runner idea. – JeredM Apr 28 '16 at 21:08
0

It's not a very elegant solution, but this would work:

Create a filter for each day of the week. Adjust your JQL so that is correct for that day of the week.

Then when you want to run your query you just use the filter for the current day.

You could even automate it using subscriptions. Just set the subscription for each filter to run on the correct day. e.g. run the Monday filter on Monday, the Tuesday filter on Teusday, etc.

Barnaby Golden
  • 4,176
  • 1
  • 23
  • 28