How to filter all current year issue and previous month

serge calderara
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.
January 11, 2021

Dear all,

I try to build to build a filter which is suppose to return all issue from current year 2021.

For doing so, I add to the end of my Jql script the following created >= -365d

But this return records which has been also created in 2020, what I am doing wrong ?

Thanks for help

regards

3 answers

3 accepted

3 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2021

Your JQL is looking for "date larger than or equal to 365 days ago", it's not looking at calendar years.

You should look to the calendar functions, start of/end of, day, week, month and year.

For this one, I think I'd use

created > startOfYear()

(If you wanted to include last year, you'd use "created > startOfYear(-1)" )

0 votes
Answer accepted
KAGITHALA BABU ANVESH
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.
January 11, 2021

createdDate >= startOfYear()

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2021
serge calderara
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.
January 11, 2021

hello @Mohamed Benziane , thanks that works.

by the way if I need to retrive issue from previous month what will be the syntax ?

Let say that if current month is february, I would like the filter of only month january.

is tehre any prevMonthofYear() ?

regards

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2021

You can use the startOfMonth() function.

This one should work for you :

startofmonth(-1)

In your scenario if you want to go back until December you will replace "-1" by "-2" and so on.

https://confluence.atlassian.com/jirasoftwareserver/advanced-searching-functions-reference-939938746.html#Advancedsearching-functionsreference-startOfMonthstartOfMonth()

serge calderara
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.
January 11, 2021

perfect thanks

Suggest an answer

Log in or Sign up to answer