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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.