Hi!
I have one question. For example I have a fieldA that has values (Val1 , Val2,Val3)
If I select val1 and val2 I want to change another fieldB and make it mandatory, if Val3 is chosen , nothing should happen. How can I do that?
Hi @QK,
Do you have Script Runner plugin? If yes,
def fieldA = getFieldById(getFieldChanged())def fieldB = getFieldById("customfield_xxxxx")String selectedOption = fieldA.getValue();if(selectedOption.equals("Val1") || selectedOption.equals("Val2")){ fieldB.setRequired(true)} else { fieldB.setRequired(false)}
Btw, there are different plugins on marketplace that provides this feature.
Tansu
Thank you,
I tried it but it doesn't work. Maybe I am writing something incorrectly. Can you tell me what field should I write in
getFieldById("customfield_xxxxx")
?
Please write your customfield id of fieldB. Ex: customfield_12345.
In order to find it;
Hello @QK
You can also use
getFieldByName(<name of your custom field>)
Please see the APIs here
https://scriptrunner.adaptavist.com/latest/jira/behaviours-api-quickref.html
It looks like you're new here. Sign in or register to get started.