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

Need help using startOfWeek in an issue query

Brittanie I'm New Here Jul 12, 2021

Hello!

I'm trying to filter tickets created over our weekend, so my team can bulk close them. They tend to be less actionable, and the issue pops up during the M-Th work week.

I've tried the following variations of the created field. 

"created = startOfWeek(5d) OR created = startOfWeek(6d) OR created = startOfWeek(7d)"

"createdDate >= startofWeek(5d)"

"(createdDate >= startOfWeek(5d) OR createdDate <=7d)"

They do not return any data, despite tickets created during that time being available.

Any ideas as to what I've completely borked here?

2 answers

0 votes
Derek Fields Community Leader Jul 12, 2021

You want to use StartOfDay(-2) for a report that runs on Monday and returns tickets that were created in the last two days.

The number in StartofWeek is the number of weeks forward or backward from the current week. So StartOfWeek(-1) is the start of last week. StartOfWeek(1) is the start of next week. 

There isn't any way (that I know of) to specify "last Saturday" or "last Sunday". The startofX() is relative to the current date.

Derek Fields Community Leader Jul 12, 2021

I went back and realized that "duh" of course you can use startofWeek(-1d) to specify the previous day.

Your JQL is failing because you are calling for "=" rather that >= or <=. Keep in mind that the created date is a date/time field, so = would have to be exactly the same date/time.

You probably want 

created >= startOfWeek(-2d) AND created < startOfWeek(). This will show you the tickets created last weekend. Using a positive number looks forward. So startOfWeek(5d) is Thursday at midnight (assuming that the week start is Sunday).

0 votes
Benjamin Community Leader Jul 12, 2021

@Brittanie 

 

It will depend when day is the start of your week and what day is the end.

Try something like below:

created >= startOfWeek(1d) and created <= startOfWeek(5d)

 

and play with the ranges so that it fits your work week.

Suggest an answer

Log in or Sign up to answer
TAGS

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