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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,770
Community Members
 
Community Events
176
Community Groups

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

0 votes

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.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events