getting the value of a MultiSelectCFType custom field

Hi,

i use:

$customFieldManager.getCustomFieldObjectByName("Activity Type").getValue($issue)

but the shown value is in brackets: [value] how did i get the value without the brackets ?

Thanks Fredy

1 answer

Hey Fred,

You need to access the option and display the options value.

Hi Bhushan, I'm sure, that you are right, but I don't know how ,-(

haha sorry try this. Havent tested it but should give you an idea.

CustomField field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Activity Type");
if(field.getCustomFieldType() instanceof MultiSelectCFType){
      Option option = (Option)field.getValue(issue);
      String value = (String)option.getValue();
}

ok, an in the velocity template :

$customFieldManager.getCustomFieldObjectByName("Activity Type").getValue($issue).getValue()

?? I'll try this as sonn I've time.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

61 views 4 0
View post

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you