JQL for assignee when issue state changed

Bram Schrijvers August 10, 2017

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
Ignacio Pulgar
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.
August 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.

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 10, 2017

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. 

Bram Schrijvers August 10, 2017

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".

Jochen Maes June 21, 2020

Did you solve this?

Suggest an answer

Log in or Sign up to answer