Forums

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

time machine JQL query

Donal Murtagh
Contributor
March 12, 2012

I can find out how many critical bugs have been opened in the last month using a JQL query like

issuetype = Bug
AND priority = Critical
AND status in (Open, "In Progress", Reopened)
AND created >= 2012-02-13

If I want to compare this figure, with the corresponding figure from last year, a naiive attempt at getting last year's equivalent might be

issuetype = Bug
AND priority = Critical
AND status in (Open, "In Progress", Reopened)
AND created >= 2011-02-13
AND created < 2011-03-13

But of course this is completely wrong, because it will tell me how many critical bugs that were created between 2011-02-13 and 2011-03-13 currently have staus open, in progress, or reopened. What I want to know is how many of these bugs had such a status one year ago.

I don't know if the JIRA data model, allows such a query to be formulated, but if it does, I'd appreciate it if someone could show me how.

1 answer

1 vote
Thomas Schlegel
Community Champion
March 12, 2012

Hi,

you can use "status was"

Best regards

Thomas

Donal Murtagh
Contributor
March 12, 2012

Thanks for the response. Would you mind showing exactly how to use this? Specifically, how do I specify the date that want to get the status for?

Thomas Schlegel
Community Champion
March 12, 2012

But if I think of it for a while, it is not necessary to ask for the status. The only relevant thing is, that the creation date is between 2011-02-13 and 2011-03-13. Every issue that is created then was in status "open", of course...

Thomas Schlegel
Community Champion
March 12, 2012

This should do it:

issuetype = Bug
AND priority = Critical
AND status was in (Open, "In Progress", Reopened)
AND created >= 2011-02-13
AND created < 2011-03-13

Donal Murtagh
Contributor
March 12, 2012

What I want to know is "on 2011-03-13 how many critical bugs created in the previous month have a status of Open / In Progress / Reopend on 2011-03-13. I don't think your query captures this, because it will wrongly include (for example) a bug that was created on 2011-03-01 and permanenty closed on 2011-03-02.

In other words, your query doesn't specify at what point in time the bug should have one of these statuses. I only want bugs that have one of these statuses on 2011-03-13 to be included.

Donal Murtagh
Contributor
March 12, 2012

That looks like exactly what I need - thanks a lot!

Thomas Schlegel
Community Champion
March 12, 2012

ok, now I think I understood...

Try that:

issuetype = Bug
AND priority = Critical
AND status was in (Open, "In Progress", Reopened) on 2011-03-13
AND created >= 2011-02-13
AND created < 2011-03-13

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events