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

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
TAGS
Community showcase
Published in Teamwork

The Confluence blog has a brand-new look AND brand-new content!

Hey Community,  Last year, the Confluence team shipped "Team Central," a hub of articles and templates on topics like project planning, knowledge sharing, and more.  We're thrilled to...

27 views 0 2
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