Forums

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

Retrieving the number of closed tickets for each quarter in the year

Manish Shah October 6, 2022

Hi All

I want to be able to retrieve the number of closed tickets within each quarter within the year.

I can use JQL:

project = "<project name>" AND resolved > "2022/01/01" AND resolved < "2022/03/31" AND status = Done

To make it specific for Q1.

This query would not work for next year:

project = "<project name>" AND resolved >= startOfYear() AND resolved < "2022/03/31" AND status = Done

Is there a way to work out the date range for the quarters dynamically? So, that it works regardless of the year we are in?

 

I've looked extensively at the date functions but can't figure out what to use!

2 answers

1 accepted

1 vote
Answer accepted
Jack Brickey
Community Champion
October 6, 2022

Try using "startofyear()"

Q1...  resolutiondate >= startOfYear() and resolutiondate <= startofyear(-3M)

I think that is correct syntax 

Manish Shah October 6, 2022

I thought if you use a minus then that would refer to the year before.

Let me try that.

But how do I dynamically resolve Q2 ...Q4 time periods??

Manish Shah October 6, 2022

This gives Q1:

project = "<project>" AND resolved > startOfYear() AND resolved <= startOfYear(3M) AND status = Done ORDER BY resolved DESC

Like Goran Pravica likes this
Manish Shah October 6, 2022

So, for Qtr2 it would be something like:

project = "<project>" AND resolved <= startOfYear(6M) AND resolved >= startOfYear(3M) AND status = Done ORDER BY resolved DESC

 

Q3:

project = <"project"> AND resolved <= startOfYear(9M) AND resolved >= startOfYear(6M) AND status = Done ORDER BY resolved DESC

And finally Q4:

project = <"project"> AND resolved <= startOfYear(12M) AND resolved >= startOfYear(9M) AND status = Done ORDER BY resolved DESC

0 votes
Craig Nodwell
Community Champion
October 6, 2022

Hi @Manish Shah I agree with Jack startOfYear()

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events