How to exclude weekends in JQL?

Celina Kim
Contributor
November 25, 2024

Hello,

 

I added a report in a team dashboard showing any issues in Waiting, Code Review and QA over 1 business day.

Here is the JQL I put: 

 

project = "SSS Kanban" AND ((status = "Code Review" AND NOT STATUS CHANGED AFTER STARTOFDAY(-12h) ) OR (status = "Ready for QA" AND NOT STATUS CHANGED AFTER STARTOFDAY(-12h) ) OR (status = "Waiting") AND NOT STATUS CHANGED AFTER STARTOFDAY(-12h) OR (status = "Code Review Completed" AND NOT STATUS CHANGED AFTER STARTOFDAY(-12h) OR (status = "QA Passed" AND NOT STATUS CHANGED AFTER STARTOFDAY(-12h) ))) AND type != Sub-task ORDER BY updated ASC

However, I don't know how to exclude weekends. Can anyone help please?

7 answers

2 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2024

Hi @Celina Kim 

Short answer: That is not possible with the built-in features of JQL.  There are marketplace addons to JQL which probably support this type of query.  And there are "workarounds" to check updated (rather than just status changes) for this type of query.

Here is a suggestion from 2010 to add this feature to JQL, although about 10 years ago Atlassian indicated it was not on their roadmap: https://jira.atlassian.com/browse/JRACLOUD-22506

Kind regards,
Bill

1 vote
Vitalii_Bobak_SaaSJet
Atlassian Partner
December 3, 2024

Hi @Celina Kim  👋

You might have to create your own solution or use a third-party app to access this data. So if you consider installing third-party add-ons to help, you can try Time in Status.

The algorithm for excluding weekends is quite simple.

First, you must set up your work calendar - add days off, breaks, holidays, etc.

11111111111.png
In the generated report, select the required project. To generate a report, select the Created by a specific date range filter—select a date three days before the current one. You can also specify the time period you need.

2024-03-15_17-26-44.png

In the report, select the Business Days data format. This will prevent the calculation from considering non-business hours.

2024-03-15_17-28-14.png

With add-on, you can create metrics tailored to your unique workflow and export the data for deeper analysis if needed.

Frame 1021.png

You can also book a live session or contact us at Support - we'll help you with add-ons. 

Add-ons developed by my team.

I hope you find this helpful 🚀

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
December 10, 2024

Hi @Celina Kim

As far as I know, you cannot exclude weekends in JQL. You can use a third party app to exclude weekends.

If you prefer using a marketplace app, you can try Status Time Reports app developed by our team.

It mainly provides reports and gadgets based on how much time passed in each status and status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.

Here is the online demo link, you can see it in action and try without installing the app.

If you are looking for a completely free solution, you can try the limited version Status Time Reports Free.

If you need any help, feel free to contact us via support@bloompeak.io or schedule a demo with us.

Hope it helps.

0 votes
Madhu_RVS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2024

Hi @Celina Kim 

As suggested by everyone, a mktplace app can help here . if you would be interested in the same, please try out an add-on we have developed for the same use case.

Time in Status Reports 

The app allows to set your working calendar with the option to exclude weekends. And then you can easily filter issues for the time in status for a specific duration.

More details here

Disclaimer : I work for the vendor who built this app

TIS - Working Days.PNG

 

 

TIS-1.png

0 votes
Gizem Gökçe _OBSS_
Atlassian Partner
December 6, 2024

Hello @Celina Kim ,

Unfortunately, excluding weekends directly using JQL is not possible with the built-in features. However, you can achieve this with Timepiece – Time in Status for Jira,developed by my team at OBSS. Timepiece offers advanced reporting capabilities, including custom calendars that allow you to exclude weekends and holidays from your calculations.

By using Timepiece, you can configure a custom calendar based on your team's working hours, and then generate a report showing issues in specific statuses, such as Waiting, Code Review, and QA, excluding weekends from the calculation.

Cstom Calendar.png

If you'd like to explore this solution further, feel free to check out Timepiece on the Atlassian Marketplace or if you'd like more details you can also schedule a live demo. We will provide a comprehensive overview of the application and address any inquiries you may have.

Hope it helps,

Gizem

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
December 1, 2024

Hi @Celina Kim

if you're open to solutions from the Atlassian Marketplace, you may want to have a look at the app that my team and I are working on: JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of so-called history columns that aren't natively available, including the time since status chanced. You can configure this column to consider a work time calendar, e.g. to exclude non-working days.

This is how it looks in action:

time-since-status-changed.gif

As you can see above, you can easily sort and filter by the time since status changed, and also use it across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

Any questions just let me know,

Best,

Hannes

0 votes
Neil Fletcher
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2024

Hi @Celina Kim 

A variation of this might work for you... I added the following JQL against the due date.

AND due < endOfWeek()

When this is added, the issues returned do not include Saturday or Sunday

2024-11-26_10-21-45.png

When it's removed, issues due Saturday or Sunday are visible.

2024-11-26_10-23-31.png

 

Neil Fletcher
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2024

...adjusting the JQL

AND due NOT IN (endOfWeek(), endOfWeek("+1d"))

this should always skip Saturday and Sunday

(my earlier attempt skipped everything after the coming Saturday 😱)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events