I´m developing a plugin for jira which contains a custom field type. The field is a select and has to be filled with options. I supply these options via the Jira method getVelocityParameters().
@Override
public Map<String, Object> getVelocityParameters(Issue issue,
CustomField field, FieldLayoutItem fieldLayoutItem) {
Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);
map.put("customOptions", getCustomOptions());
return map;
}
getCustomOptions() returns a Hashtable with the Options i need.
To access and display these options i used a #foreach loop in the template:
#foreach($customOption in $customOptions)
<option id="$customOption.Id" value="$customOption.Value">
$customOption.Label
</option>
#end
Instead of showing the returned Objects it simply just display the text itself, only the "$customOption.Id" is displayed correctly. And writing only "$customOption" shows the whole reference to the object. So i CAN access the object and its id but not the other properties.
Id is an int, while label and value are Strings.
i searched for solutions and tried different things to solve this problem, e.g.: $!customOption.Label, ${!customOption.Label}, ${customOption.Label}, $customOption.getLabel()
I can´t find the problem here, because the id is working properly.
Sry for the broken english.