Scripted field that stores user that last resolves issue?

Tsol
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.
November 11, 2013

Hi there,

i'm looking for a way to store the user that last resolves an issue.

I took a look on the scripted fields but i didn't manage to make it work.

The way i'm approaching it is that the field value will be the user that turns the resolution from null to an existing value.

Maybe there is a better way to do it but i have no experience with JIRA changehistory.

Thanx in advance,

Kostas

1 answer

1 vote
Henning Tietgens
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.
November 12, 2013

Try this:

import com.atlassian.jira.component.ComponentAccessor

changeItems = ComponentAccessor.changeHistoryManager.getAllChangeItems(issue)
if (changeItems?.size()>0) {
    ComponentAccessor.userUtil.getUserByKey(changeItems.findAll{it.field=='resolution'}.sort(false).last().userKey)
} else {
    null
}

Suggest an answer

Log in or Sign up to answer