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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Get MultiSelect CustomField Values

Hi

I need to get the selected values for a Custom Multiselect field. Had searched the forums but there is no concrete answer for the same.

2 answers

1 accepted

0 votes
Answer accepted

Refer to

https://developer.atlassian.com/static/javadoc/jira/6.2.1/reference/com/atlassian/jira/issue/fields/CustomField.html#getValue%28com.atlassian.jira.issue.Issue%29

Multiselects will return a list of Option. You can try something like this.

CustomField customField = customFieldManager.getCustomFieldObjectByName("name_of_cf");

List<Option> options = (List<Option>) customField .getValue(issue);

Great Thanks, but how to determine the options that are actually selected by the user.

List<Option> options = (List<Option>)cfmselect.getValue(issue);
for (int i = 0; i < options.size(); i++) {
Env=options[i] + " " + Env

}


Added the above solved the issue. Thanks

Like Raj Hazarika likes this

Hi @Pushparaj Bhask 

 

Need your help on this.

I have the same requirement , what i need is when ever i have added something in a custom field which is a multi select in an EPIC issue , its parent(which also contains same custom fields which values , but doesnt contain all new values or unique values which are there in its child issue) should get updated with the unique value or new value in the parent issue's custom field.

I have tried with Listener , but unable to do it.

Can you help me on this code? you have created a behavior or Listener for this? can you provide help me for the code? Any help will be appreciated.

 

Thanks & Regards

Manas

In Javascript do something like this

var selectedOptions = AJS.$("your_multiselect_component").val();

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - Spring 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

147 views 3 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you