Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to filter time windows with JQL

Hello,

I'm struggling with a JQL query to filter results in several time windows. I need to filter some issues outside business hours, so:

  1. from Mon to Fri from 8:00 p.m. to 8:00 a.m.
  2. from Sat to Sun anytime

These are the query that I have deployed, but I'm missing something in the syntax because the result I have are inconsistent:

  1. (("Date and time TT Processing[Time stamp]" >= startOfDay()) and ("Date and time TT Processing[Time stamp]" <= startOfDay("+8h"))) OR (("Date and time TT Processing[Time stamp]" >= startOfDay("+20h")) and ("Date and time TT Processing[Time stamp]" <= startOfDay("+1d")))
  2. ("Date and time TT Processing[Time stamp]" >= startOfWeek("+6d")) OR ("Date and time TT Processing[Time stamp]" < startOfWeek("+8d"))

Can someone please tell me whaat I'm doing wrong?

Thanks.

1 answer

1 accepted

0 votes
Answer accepted

Hi @Gerardo Dalena 

Those functions you are using from advanced JQL are relative to the current day.  They do not float as I believe you are expecting for any day.  I do not believe that is possible with out-of-the-box Jira Cloud's JQL.  There are marketplace scripting add-ons which could help.

For your weekly query, startOfWeek() is again relative to the current day, and weeks start on Sunday with 1.  So your >=+6 includes Friday and your +8 is in the future.  :^)  You could check last week by using  >= startOfWeek(-1d) to < startOfWeek(+1d)

Best regards,
Bill

Hello @Bill Sheboy 

that's a good food for thought, thanks!

Best regards,

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

216 views 2 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you