Forums

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

Need a validator that makes field Custom_Field_one required if project key = X

Frank Racioppi March 1, 2018

I have a need to make a multiselect list become required if a project key =X

My plan is to use the scriptrunner validator option in the workflow transition.  

 

 

My current thought is:

if (issue.projectObject.key == 'My Project Key' &&

cfValues['Custom_Field_one'] == 'None') {

    return true

}

 

Note: the multiselect list cannot be set as a required field by default and therefore "none" will be an option. 

1 answer

0 votes
Aleksandr Zuevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2018

Hi,

I suppose you need Behaviour script which invokes setRequired(true) for the field. See https://scriptrunner.adaptavist.com/4.3.1/jira/behaviours-overview.html#_using_a_server_side_validator_to_set_the_fix_versions_required.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events