Forums

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

Mandatory field is not getting non-mandatory when the behaviour is changed

rahi bala September 28, 2018

Hi, I have a requirement to make a custom field1 as "Mandatory" when other custom field2 value is filled/set. (This is done using scriptrunner(Behaviour)) but the problem I face here is when I delete/remove the value in customfield2, customfield1 is still mandatory :( I want to make the customfield1 as non-mandatory when I don't have values filled in customfield2

1 answer

0 votes
Alvin
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 4, 2018

Hi @rahi bala

try something like this on your code, I will just put here the if-else statement

if (customfield2) {

                         customfield1.setRequired(true)

} else

                        customfield1.setRequired(false)

 

Regards,
Alvin

Suggest an answer

Log in or Sign up to answer