Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Filter Start Of Week For A Specific Date

Joseph November 2, 2022

Is there a way to get the start of week for a specific date, if I want to see what the start of the week is of 2022-11-02, I was hoping I could do something like startofweek(2022-11-02), but it only takes inputs like 1M or 1d. 

 

I want it to be static though so it doesn't change though and is locked in for the start of the week for that specific date

2 answers

1 vote
Hamza Chundrigar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2022

Hi @Joseph 

Have you considered using the exact date range? This would give you a static result which you can save for repeated use.

For example, say you want to create a JQL filter that shows me issues from Monday Oct 31st 2022 to Sunday Sept 6th 2022 (a full week range)

1) You could retrieve all issues within the exact date range using the following query (this will give you a static result):

created >= 2022-10-31 AND created <= 2022-11-06 order by created DESC

2) If you want to narrow down your search to a specific project, you can use:

project = SKP AND created >= 2022-10-31 AND created <= 2022-11-06 order by created DESC

 *Replace SKP with your desired Project Key

3) If you want to narrow down your search to a specific issue type, you can use:

issuetype = Bug AND created >= 2022-10-31 AND created <= 2022-11-06 order by created DESC

 You could combine 2 and 3 by using:

project = SKP AND issuetype = Bug AND created >= 2022-10-31 AND created <= 2022-11-06 order by created DESC

Once you're done > click 'Save As' > Name your filter > Save the filter 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2022

Hmm, good point, I may not quite have understood the question!

It is hard to explain this without an essay, so I will use an imaginary example.

Let's say I'm looking for some old issues from a few months ago, but I can't remember the exact date range I need to use.  I know I'm looking for "created after the second Sunday in March", so I want to do "created > start of the week which must have contained the 10th March", but I don't have a calendar to hand to look it up.

Joseph November 2, 2022

Ya, my current solution is just to hard code the start and end date, but I will have to do that each week as I am setting this up as a weekly. newsletter in Confluence that shows what was completed for a given week.  I was trying to see if there was an easier way to not have to find the start and end date of each week and just know one of the dates essentially

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2022

I never like hard-coding, unless there's an absolute truth behind it so there's no point doing it another way.

I'm afraid in this case that there is not a simple way to do it. 

With a scripting or automation tool, we might have a few options, but the off-the-shelf tools can't do it.  (With an app, I can think of ways to do compounded tricks -using "start of week" against a scripted field based on when the issue was created/updated might work, for example)

However, you say 

"I am setting this up as a weekly. newsletter in Confluence that shows what was completed for a given week. "

You do not need a fixed date to do that.  Surely a newsletter should be reporting on "what we fixed this week", not "everything we have fixed since the beginning of the week starting 10th March 2026"?

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2022

I'm afraid not.  The startofWeek function only does relative values (so you can do "start of week 6 months ago")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events