Forums

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

JQL query for filter by date range between 20th and 19th a month

Tino Janke July 24, 2019

Hi!

I`d like to filter issues by their date of creating. The date should be in a range between 20th of the previous month (YYYYMM20 00:00) until 19th of the current month YYYYMM19 23:59). The filter is executed between the 20th and the 30th of the current month. As the filter is executed every month, the month in the JQL should be dynamic.

I`ve tried to combine 2 values for startofmonth like this:

project = XXX AND created > startofmonth(-1+20d) AND created <= startofmonth(19d)

which gives an error, as there is only 0 to 1 value allowed.

Are there any other possible solutions?

Thanks in advance!

 

2 answers

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.
July 24, 2019

If you don't find a way to make a dynamic filter, you could just hard code the dates and each month simply load the filter, bump your month up by one, and click the save button.

created >= "2019-06-20" and created < "2019-07-20"

0 votes
Thomas Deiler
Community Champion
July 24, 2019

Dear @Tino Janke ,

try this:

createddDate > startOfMonth(-10d) AND createddDate <= startofmonth(19d)

So long

Thomas

Tino Janke July 24, 2019

Dear @Thomas Deiler 

thanks a lot - that works for February but what about any month with (29) 30 or 31 days? 1-3 days are missing then.

For example a query today serves all issues from 21.06.2019 until 19.07.2019. The 20.06.2019 is missing.

We were thinking about combining:

- Set the beginning of the previous month: startOfMonth(-1)
- Add 20 days

Is there any possibility?

Cheers

Thomas Deiler
Community Champion
July 24, 2019

Dear @Tino Janke ,

This will not be possible with standard Jira. For more complex JQL queries, eventually a plugin can help.

So long

Thomas

Tino Janke July 24, 2019

Thanks anyway, @Thomas Deiler !

Suggest an answer

Log in or Sign up to answer