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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,228
Community Members
 
Community Events
184
Community Groups

JQL for After Hours and Weekends

How do I write JQL to reflect tickets that were created on weekends and after 5pm on weekdays for certain Issue types? 

2 answers

1 accepted

2 votes
Answer accepted
Riley Venable (Atlas Bench)
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 03, 2023
To write JQL to reflect tickets that were created on weekends and after 5pm on weekdays for certain Issue types, you can use the following query: ``` createdDate >= startOfWeek(-1d) and ( (createdDate >= startOfDay() + 17h or createdDate < startOfDay() + 8h) and issueType in (issueType1, issueType2, issueType3) ) ``` This query searches for issues that were created after 5pm on weekdays and on weekends for the specified issue types.

The `createdDate` field is compared to the start of the current week minus one day (`startOfWeek(-1d)`) to include the entire previous weekend. It then checks if the issue was created after 5pm (`createdDate >= startOfDay() + 17h`) or before 8am (`createdDate < startOfDay() + 8h`) on weekdays.

Finally, it filters by the specified issue types using the `issueType in (issueType1, issueType2, issueType3)` clause.

Note that `startOfDay()` and `startOfWeek()` are functions that return the start of the current day or week, respectively, and `17h` and `8h` specify the start times for the weekdays. You can adjust these values as needed to fit your specific requirements.

Thank you for your help. This is very informative and greatly appreciated!

0 votes
Ash Yadav - VMotion IT Solutions
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 03, 2023

Hi @Rainy Hausen 

 

You can use the following for tickets that were created on the weekend: 

created > startOfWeek(-26h) AND created <= startOfWeek(1d) ORDER BY created DESC

 

Small edit: 

I just noticed @Riley Venable (Atlas Bench) has provided a rather comprehensive answer so I'll leave the rest but I think you already have your answer with the below :) 

 

All the best, 

 

Ash 

Thank you for your help!

Suggest an answer

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

Atlassian Community Events