IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); FieldLayoutItem fieldLayoutItemResolver = componentManager.getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem(customField); customField.updateValue(fieldLayoutItemResolver, issue, new ModifiedValue((SelectCFType) customField.getValue(issue), "Closed Issue"),changeHolder);
I am getting the following exception.
javax.script.ScriptException: javax.script.ScriptException: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'Known Issue Documented' with class 'com.atlassian.jira.issue.customfields.option.LazyLoadedOption' to class 'com.atlassian.jira.issue.customfields.impl.SelectCFType'
List<Option> options = optionsManager.findByOptionValue("Closed Issue");
log.debug(customField.getValue(issue).toString())
for(Option option : options){
if(option.getRelatedCustomField().getCustomField().getName().equalsIgnoreCase(customField.getName())){
issue.setCustomFieldValue(customField, option);
break;
}
}
Thats it!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.