简体   繁体   English

JIRA JQL:在最近的未来星期三或之前获取所有到期任务

[英]JIRA JQL: Get all tasks due on, or before, the closest future Wednesday

How do I create a JQL query, for a JIRA Agile swimlane, that displays all tasks due on the closest Wednesday in the future.如何为 JIRA Agile 泳道创建 JQL 查询,以显示在未来最近的星期三到期的所有任务。 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.我也尝试过使用endOfWeek一些endOfWeek ,但仅适用于我的 Monday 示例,而不适用于我的 Thursday 示例。

duedate <= endOfWeek(-3d)

I think it is not possible just with JQL.我认为仅使用 JQL 是不可能的。 Can you use scripts?可以使用脚本吗? or plugins?或插件? do you have scriptrunner plugin installed??你有安装scriptrunner插件吗??

  • If you can get scriptrunner: there is a feature, Scripted field: you could add a scripted field always hidden wich calculate the next wednesday.如果您可以获得 scriptrunner:有一个功能,Scripted field:您可以添加一个始终隐藏的脚本字段,以计算下一个星期三。 So then you JQL could be just duedate<=wednesday那么你的 JQL 可能只是 Duedate duedate<=wednesday 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.问候。

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.调整您的 JQL,使其适用于一周中的那一天。

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.只需将每个过滤器的订阅设置为在​​正确的日期运行。 eg run the Monday filter on Monday, the Tuesday filter on Teusday, etc.例如在星期一运行星期一过滤器,在星期二运行星期二过滤器等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM