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 vote

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 vote
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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

12,063 views 15 13
Join discussion

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