Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

getting the value of a MultiSelectCFType custom field

Fred Hauschel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2013

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

0 votes
Bhushan Nagaraj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2013

Hey Fred,

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

Fred Hauschel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

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

Bhushan Nagaraj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

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();
}

Fred Hauschel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2013

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