Problems getting Custom Field options

srinivasp
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.
August 3, 2012

I am facing issues while loading options from a custom field. with the below code, i am getting the right values from option objects. Can anyone suggest what is wrong with the below code?

CustomField customField = customFieldManager.getCustomFieldObjectByName("Affects Build");

MutableIssue issue = issueManager.getIssueObject("BUG-1");

FieldConfig fieldConfig =  customField.getRelevantConfig(issue);

OptionsManager optionsManager = ComponentManager.getComponentInstanceOfType(OptionsManager.class);

List<Option> optionsList = optionsManager.findByParentId(customField.getIdAsLong());

List<Option> optionsList = options.getRootOptions();*/

if(optionsList.size()>0){

List<String> buildOptions = new ArrayList<String>();

for(Option option : optionsList){

buildOptions.add(option.getValue());

}

2 answers

1 accepted

0 votes
Answer accepted
srinivasp
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.
August 6, 2012

There is something wrong in my javascript and so not properly rendered. I fixed the javascript and now it is fine. The code is actually working.

0 votes
srinivasp
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.
August 5, 2012

Hi Atlassians, Any update please??

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events