Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Get the Selected Entries from a Multi-select custom field

I'm using JIRA Software v8.4.0

The multi-select I'm trying to get the selections from is in a tab of a screen "Required Reviewers".

 

I've read several posts, however, many are for JIRA version prior to v7's depreciated classes.

I've tried to run the following code in the Script Runner console, but there are problems.

Please help.

 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;

//def issue = event.issue as Issue

// Get a pointer to the current logged in user
def CurrentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def commentManager = ComponentAccessor.commentManager
def cField = customFieldManager.getCustomFieldObjectByName("Required Reviewers")
//def cFieldValue = issue.getCustomFieldValue(cField).toString()

Tim

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 27, 2019

This code would work right up until the last line.  The custom field will not return a string, it will return a list (collection/array etc) of user objects.

TAGS
AUG Leaders

Atlassian Community Events