有一个例子,如果你的意思是ScriptRunner Simple Validator:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.customfields.manager.OptionsManager cfId = 121500L // paste you field id here cfValue = getCustomFieldValue(issue, cfId) cfOptions = getCfOptions(issue, cfId) return cfValue?.size() == cfOptions?.size() // return current cf value def getCustomFieldValue(issue, Long cfId) { issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(cfId)) } // returns all options for select custom field def getCfOptions(issue, Long cfId) { def cfObj = ComponentAccessor.customFieldManager.getCustomFieldObject(cfId) def fieldConfig = cfObj.getRelevantConfig(issue) ComponentAccessor.getComponent(OptionsManager).getOptions(fieldConfig) }