Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Validation of all options in a single select list

ys July 30, 2019

Hello, is it possible to check the value of a field against all options of a dropdown list within workflow validation? The examples given from the documentations only lets you compare the actively selected value in the dropdown list, not the whole list. 

https://scriptrunner.adaptavist.com/5.5.9/jira/recipes/workflow/validators/simple-scripted-validators.html

cfValues['My Select List']?.value == 'My value'


'My value' in cfValues['My Multi List']*.value

 

1 answer

0 votes
Yury Lubanets
Contributor
August 8, 2019

Hi @ys 

If I understand you right you need all possible values of the select list field. You can get it using the following code

def config = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName('cfName').first().getRelevantConfig(issue)
def optionValues = ComponentAccessor.optionsManager.getOptions(config)*.value

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events