Forums

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

JQL query filter by modulo date range

Walter_Zambotti June 18, 2020

I have a working JQL query that returns issues that fall in the week of every* four month anniversary of the created date.

(every* : Every four months so 4, 8, 12, ....)

Here is my query:

(created >= startOfWeek(-4M) AND created <= endOfWeek(-4M))
OR
(created >= startOfWeek(-8M) and created <= endOfWeek(-8M))
OR
(created >= startOfWeek(-12M) and created <= endOfWeek(-12M))
OR
(created >= startOfWeek(-16M) and created <= endOfWeek(-16M))
OR
(created >= startOfWeek(-20M) and created <= endOfWeek(-20M))
OR
(created >= startOfWeek(-24M) AND created <= endOfWeek(-24M))
OR
(created >= startOfWeek(-28M) and created <= endOfWeek(-28M))
OR
(created >= startOfWeek(-32M) and created <= endOfWeek(-32M))
OR
(created >= startOfWeek(-36M) AND created <= endOfWeek(-36M))
OR
(created >= startOfWeek(-40M) and created <= endOfWeek(-40M))
OR
(created >= startOfWeek(-44M) and created <= endOfWeek(-44M))
OR
(created >= startOfWeek(-48M) AND created <= endOfWeek(-48M))
OR
(created >= startOfWeek(-52M) and created <= endOfWeek(-52M))
OR
(created >= startOfWeek(-56M) and created <= endOfWeek(-56M))
OR
(created >= startOfWeek(-60M) AND created <= endOfWeek(-60M))
OR
(created >= startOfWeek(-64M) and created <= endOfWeek(-64M))
OR
(created >= startOfWeek(-68M) and created <= endOfWeek(-68M))
OR
(created >= startOfWeek(-72M) AND created <= endOfWeek(-72M))
OR
(created >= startOfWeek(-76M) and created <= endOfWeek(-76M))
OR
(created >= startOfWeek(-80M) and created <= endOfWeek(-80M))

As you can see it only covers back 80 months.  Eventually this will range will be exceeded and I will have to add more filters.

I want it to go ad-infinitum beyond 80 months.

Is there a way I can use some kind of modulo function to generalize my query?

1 answer

0 votes
Payne
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 19, 2020

Rather than that, I'd advocate for closing issues more than 7.5 years old. 

Walter_Zambotti June 21, 2020

Nothing in my post suggests the issues are open or closed!  I'm not sure what that (open or closed) has to do with it!

Like Payne likes this

Suggest an answer

Log in or Sign up to answer