Is it possible in Java to retrieve an array of possible options that a user is offered in a custom multi-check field?
For example, my multi-check field 'ManyOptions' has 3 true/false options: "Option1", "Option2", "Option3". I can successfully retrieve an array containing all options that are marked True ([ "Option1", "Option2" if the first and second are checked, for example).
If I could retrieve an array of all available options, then I can compare the two arrays to see if a user has checked all, some, or none.
I am using JIRA 5.2 with the 'Misc Custom Fields' plugin and with the following code:
@Formula:
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.CustomFieldManager;
String sumCustomFieldValues( String customFieldId, Issue theIssue ) {
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField = customFieldManager.getCustomFieldObject(customFieldId);
String val = "";
if(theIssue.getCustomFieldValue(customField) != null) {
try {
val = String.valueOf(theIssue.getCustomFieldValue(customField)).toString();
} catch (Exception e) {
}
}
val = theIssue.getCustomFieldValue(customField).getClass().getName();
return val;
}
sumCustomFieldValues("customfield_10001", issue.getIssueObject());
-->
The returned value is dummied a bit to just return a String for debugging purposes.