JQL Query (more than once status)

Rahul Aich [Nagra]
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 18, 2014

Hi

I want to identify issues which have been into Resolved status more than once (i.e. resolved-> open-> resolved-> Open)

I am aware we have a WAS operator which tell us if the issues has been in a status at least once before.

But how do we identify if it has been there more than once?

Rahul

2 answers

1 vote
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2014

Hi Rahul,

You won't be able to find that by default through the database as you won't be able to "count" using the Issue Navigator. The following query should help you to find this in the database though:

SELECT p.pkey||'-'||ji.issuenum AS "Project Key" FROM jiraissue ji 
	JOIN project p ON p.id = ji.project 
WHERE ji.id IN (
	SELECT issueid FROM changegroup cg
		join changeitem ci on cg.id = ci.groupid
	WHERE ci.field = 'status' AND ci.newstring = 'Resolved'
	GROUP BY issueid
	HAVING count(newvalue) > 1
);

You can see from within the issue how many times it was transitioned to each status using the 'Transition Summary' feature from the JIRA Suite Utilities add-on.

I hope this helps

0 votes
Udo Brand
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 18, 2014

how about

status changed from resolved to open and status changed from open to resolved

Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2014

This will list you issues that have been reopened, but not necessarily that have been closed afterwards. :)

As those are statements JIRA will understand them separately, so "status changed from resolved to open" may happen to issues where "status changed from open to resolved".

Also, something like this would only work if those are actually two immediate steps (there's no intermediate step).

Udo Brand
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 18, 2014

> Also, something like this would only work if those are actually two immediate steps (there's no intermediate step)

True, I implied that there is a transtion from resolved to open and from open to resolved. But that query would show issues that have been in status resolved more than once (and that was the question).

Suggest an answer

Log in or Sign up to answer