Question about scriptrrunner User scripted field

Adolfo Casari
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, 2015

I am using a scripted field to show in a subtask its parent's assignee. I have:

return (parent?.assignee == null ? null : ApplicationUsers.from(parent.getAssignee() as User) as ApplicationUser)

and the template is User Picker.

However the field is show in the General tab of the issue, not in the People tab, without the link.

This is version 2.1.16 in JIRA 6.1.5

Any hints?

2 answers

1 accepted

0 votes
Answer accepted
JamieA
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 18, 2015

I don't think the feature for showing the field in the correct section depending on the template was in that old version...

Adolfo Casari
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 18, 2015

Upgrade it is. Thanks.

0 votes
Alejo Villarrubia [Adaptavist]
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, 2015

could you try this?

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserManager

def userManager = ComponentAccessor.getComponent(UserManager)

issue.parentObject?.assignee == null ? null : userManager.getUserByName(issue.parentObject.assignee?.name)
Adolfo Casari
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, 2015

It keeps showing the name in the General tab. I understand that in order to appear in the People tab the custom field must implement an interface. Thanks.

Alejo Villarrubia [Adaptavist]
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, 2015

I forgot to mention that I tested the code against the latest versions of Jira and SR, so the issue might be related with the older versions your instance is running. What do you mean by "must implement an interface"?

Adolfo Casari
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, 2015

I am using a Participants CF from Jira Toolkit, and this works OK in my version of JIRA, this field is shown in the People tab: https://bitbucket.org/atlassian/jira-toolkit-plugin/src/4c309b834fb5bde709210b2bc0fd4d6e5d5243e8/src/main/java/com/atlassian/jira/toolkit/customfield/ParticipantsCFType.java?at=master Note the line: ApplicationUser assignee = userConverter.getUserFromDbString(issue.getAssigneeId());

Suggest an answer

Log in or Sign up to answer