Forums

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

Make a field mandatory if other field = 'X' on create screen

Dan27
Contributor
October 3, 2018

Hello,

I would like to make 'environment platform' field (Text Field type) a mandatory field, only if 'Patch type' field (Select List (single choice) type) = 'X'.

How can I do it? Behaviours?

 

Thanks,

Daniel

1 answer

0 votes
Yogesh Mude
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.
October 3, 2018
Dan27
Contributor
October 3, 2018

Hi @Yogesh Mude ,

I wrote the behaviour with thosr links help:

def selectCFValue = getFieldByName("Patch Type")
def targetField = getFieldByName("Environment/ Platform")

if (selectCFValue.getValue() == "GA Point Patch" || selectCFValue.getValue() == "GA Cumulative Patch")
targetField.setRequired(true)
else
targetField.setRequired(false)

 

It is still not working, Maybe I should choose an option there? Can you help me with it?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events