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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

61 views 2 6
Read article

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