排除Jira服务器上JQL中的一系列日期中的星期六和星期日。

huangapple go评论61阅读模式
英文:

Exclude Saturday and Sunday from a range of dates in JQL on Jira Server

问题

以下是翻译好的内容:

我有这个查询

project = "xyz" AND due > startOfDay() AND due = startOfDay(3d)

这是做什么的,它会给我显示到期日期距今仅剩3天的问题。

即如果我有一个票据,截止日期是2023年7月10日,今天是2023年7月7日,问题应该显示出来。

现在从7月7日到7月10日,有周末,即7月8日和7月9日(星期六和星期日)。

当前的JQL包括周末。

我希望JQL将其排除在外。

预期结果:如果到期日期是7月10日,那么在今天是7月5日时,它应该给我结果。

如何使用JQL实现这一点?

英文:

I have this query

project = "xyz" AND due > startOfDay() AND due = startOfDay(3d)

What this does is , it gives me the issues where there are exactly 3 days remaining until the due date from today.

i.e if I have a ticket which has a due date of 10th July 2023 and today is 7th July 2023, the issue should show up.

Now from the 7th July to 10th July , there are weekends 8th and 9th July ( Sat and Sun).

Currently what the JQL is giving is including the weekends.

I want the JQL to exclude it.

Expected result: If the due date was on 10th July, it should give me the result when today was 5th of July.

How do I achieve this with JQL?

答案1

得分: 1

如果您的截止日期少于7天,您可以使用以下JQL来获取三个工作日后的截止日期:

(duedate < startOfWeek(1) AND duedate = startofday(3d)) 
OR (duedate > startOfWeek(1) AND duedate = startofday(5d))

如果您想要检查五个工作日后的截止日期,您可以使用:

(duedate < startOfWeek(1) AND duedate = startofday(5d)) 
OR (duedate > startOfWeek(1) AND duedate = startofday(7d))

第一行检查了周末前的截止日期。第二行检查了下周的截止日期,并在周末上加了两天。如果截止日期超过7天,您需要根据您确定将在现在和截止日期之间的每个周末添加2天的情况来调整数字。

如果您想要检查十个工作日后的截止日期,您可以确定在截止日期之前有一个或两个周末。您可以使用:

(duedate < startOfWeek(2) AND duedate = startofday(12d)) 
OR (duedate > startOfWeek(2) AND duedate = startofday(14d))
英文:

If your due date is less than 7 days away, you can use the following JQL for a due date three business days from now:

(duedate < startOfWeek(1) AND duedate = startofday(3d) ) 
OR  (duedate > startOfWeek(1) AND duedate = startofday(5d))

If you want to check for a due date five business days from now you can use:

(duedate < startOfWeek(1) AND duedate = startofday(5d) ) 
OR  (duedate > startOfWeek(1) AND duedate = startofday(7d))

The top line checks a due date before the weekend. The second line checks a due date next week and adds two days for the weekend. If the due date is more than 7 days away, you will need to adjust the numbers by adding 2 days for each weekend you know for sure will be between now and the due date.

If you want to check for a due date ten business days from now, you have for sure one and maybe two weekends before the due date. You can use:

(duedate < startOfWeek(2) AND duedate = startofday(12d) ) 
OR  (duedate > startOfWeek(2) AND duedate = startofday(14d))

huangapple
  • 本文由 发表于 2023年7月5日 00:29:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76614468.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定