I'm looking for a way to display only certain values of a customfield based on the value of a previous customfield. I do not want to hide/show the entire customfield, only limit the values available. Is there a way to achieve this?
import com.atlassian.jira.component.ComponentAccessor
def optionsManager = ComponentAccessor.getOptionsManager()
def cfManager = ComponentAccessor.getCustomFieldManager()
def lobField = getFieldById("LOB:")
def lobProgram = getFieldById("LOB:Programs")
def lobProject = getFieldById("LOB:Project")
def cfLobField = cfManager.getCustomFieldObjectByName("LOB:Programs")
def fcLobField = cfLobField.getRelevantConfig(issueContext)
def lobOptions = optionsManager.getOptions(fcLobField)
def analyzeSet = ["MGV", "BLAST"]
if(lobField.getValue() == "Analyze"){
lobProgram.setFieldOptions(lobOptions.findAll{it.value in analyzeSet}.collectEntries { [(it.optionId).toString() in it.value] })
}