JQL for assignee when issue state changed

As a software team lead, I'd like to gather some useful statistics from JIRA to improve the team's performance. One of those statistics is the number of resolved and reopened issues.

We have set up our workflow to react on triggers from Bitbucket:

"open" -> "in progress" when a branch is created

"in progress" -> "in review" when a pull request is created

"in review" -> "resolved" when the pull request is merged (by the developer)

This means that it's not the assignee (developer) that is actually doing the state changes, as the state is being transitioned automatically.

A query to find the issues being "resolved" by a developer is quite simple:

status changed FROM "in review" TO "resolved" BY "<developer>"

But this doesn't produce any results, because of the automatic state transitions.

So what I'm looking for, is a query that finds issues being "resolved" *while* the assignee is "<developer>". Pseudo-query:

status changed FROM "in review" TO "resolved" WHILE assignee = "<developer>"

Obviously, the "WHILE" operation is not supported, so this doesn't work.

Is there an alternative way to query the issues I'm looking for?

Note that simply quering the current assignee is not correct, as this may have changed since the issue was resolved.

Thanks!

2 answers

0 votes

Since the assignee is not changing when the issue is resolved thus you can use something like

(status changed FROM "In review" to "resolved") and assignee in membersOf("jira-developers")

Here instead of "jira-developers" group you can use any group and make sure that group is in the "developer" role of the project.

I prefer using groups and adding them into roles that way if an employee leaves the company then I don't see inactive usernames in the roles mapping rather since it's the group names in the role mapping thus users can be added/removed from the groups. 

Thanks for your response.

This will work in most cases for resolved issues, but it won't work for issues that have been reopened (resolved -> open). Because this is querying the *current* assignee, not the developer that was assigned to the issue at the time it got resolved.

So I'm really looking for a combination of "state has changed" + "assignee *was* developer X at that time".

0 votes
Ignacio Pulgar Community Champion Aug 10, 2017

Natively, you have this JQL:

status changed from x to y on <date> by <username> AND assignee was <username> on <date>

However, such a JQL relies on you providing the assignee and dates, which is not very handy for reporting.

assignee in membersOf("<group name>") would retrieve the correct issues that matched the condition, but will not show who is the actual user who made the condition check to be 'true'.

JQL returns just issues that match the specified conditions. Nothing else.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

424 views 1 14
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot