Forums

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

Display tickets which are 7 and 8 days old

Simona Mrozowska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 9, 2023

Dear All

 

I would like to filter the tickets which have been created 8 and 7 days ago excluding weekends.

Important is that the day of ticket creation should be counted as day 0, so actually we need to filter 8 and 9 days old tickets excluding weekends.

AND (created >= startOfDay(-10d) AND created < startOfDay(-9d) AND created != startOfWeek(-2d) OR created >= startOfDay(-9d) AND created < startOfDay(-8d) AND created != startOfWeek(-2d))

The above filter, which we are testing, shows incorrect results at the beginning of the working week. The correct results are displayed not until Wednesday. Starting from  Wednesday the displayed tickets are indeed 7 (8) and 8 (9) days old. 

I have no idea what needs to be changed in the JQL to get correct results displayed already on Monday.

Thanks a lot in advance!

BR Simona 

2 answers

0 votes
Andrew Laden
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.
June 9, 2023

As you noticed, its pretty hard to get that logic into a filter. So dont.

Make a custom field called "Business days since created". and run some automation to look for relevant issues. (ie not resolved, or for any other reason not counted) set your automation to run once each business day, and increment the value in that field. by 1.

Andrew Laden
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.
June 9, 2023

The real problem is that the behavior of the filter will be different depending on when you run it, not based on any value in the issues. (ie, if the filter is run on monday or tuesday, it behaves differently then if it were run on a wednesday - friday. But there is no way to catch that logic in a filter normally, You can get the current day in a function, but you have nothing to compare it to.

A simple query in JQL (also known as a 'clause') consists of a field, followed by an operator, followed by one or more values or functions.

So while there can be a function to return the current day, you have to have a field to compare it to.

So another trick is to find a way to put the current day of the week into an issue field, and then you can use that in your equation. This would also involve some automation or scripting. Its a little tricky, but you could do that if you really wanted. So if you had a custom field called "currentDay" that you updated on all active issues once a day to set the value to the current day, you could then use that field in a expression, (if currentDay in ("monday", "Tuesday") and created blah blah OR currentDay not in ("monday", "Tuesday") and created blah blah)

One advantage of this method is that since you arent incrementing anything, you dont have to worry about running the automation multiple times. the method is Idempotent.

0 votes
Kristján Geir Mathiesen
Community Champion
June 9, 2023

Hi @Simona Mrozowska and...

giphy

I don't think you can do this with OOTB functionality in Jira. Maybe the Marketplace has some 3rd Party App.

Smartvalues (for Jira Automation) does have business day function but they cannot be used in filters. Maybe you could create an automation rule to email the issues that fit your criteria? Or think outside of the box in some other way...

HTH,
KGM

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events