Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

query to include only weekends

I am looking to create a query that pulls reports for only weekends (Saturday and Sunday) for the entire year.

Please advise if this is possible or for any alternatives.

Thank you. 

Erica Escobar

2 answers

0 votes
Johnny Mon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 21, 2022

Hi @Erica Escobar,

This is a late response to discuss an alternate solution:

The JQL for getting the ‘past weekend issues’, for example, created in the past weekend, is

(createdDate >= startOfWeek(-1d) AND createdDate < startOfWeek(1d)) order by createdDate ASC

The startOfWeek() can be use repeatedly to get previous weeks as well. Here is an example for the past 4 weekends:

(createdDate >= startOfWeek(-1d) AND createdDate < startOfWeek(1d) )
OR (createdDate >= startOfWeek(-8d) AND createdDate < startOfWeek(-6d))
OR (createdDate >= startOfWeek(-15d) AND createdDate < startOfWeek(-13d))
OR (createdDate >= startOfWeek(-22d) AND createdDate < startOfWeek(-20d))
ORDER BY createdDate ASC

Because all the data are historical, we can utilize JQL to get the past weekend data, once a week, in a scheduled job. The data for each weekend can be inserted into a database table or concatenated into a data store, which you can use to run the reports.

To populate the previous weeks' data, we can use the example JQL above with OR clauses, or run them in separate queries, one for each weekend.

The previous comment on using a custom script field in ScriptRunner will work seamlessly with reports by adding a new custom field that marks an issue as a ‘weekend issue' and then utilizing it in a filter.

Hope the new information helps.

Thank you. This simplified things for me. The date functions and logic are some of the most confusing JQL queries for me.

0 votes
David Berclaz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 14, 2022

Hi @Erica Escobar

Welcome to the community!

What kind of query are you thinking about? A query listing all Jira issues created (or resolved?) during the weekend?

On Jira Server/DC I would be using a Script Field (ScriptRunner App), but I'm not sure how to do it on Jira Cloud.

Cheers,

David

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