You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I would like for when i check the radio button with a value "Yes", and the other custom field to be mandatory. I did this as a behaviour in scriptrunner but it does not seem to work at creation.
Here is my code:
def customA= getFieldById("customfield_16191") // regular select custom field
def customB= getFieldById("customfield_14200") //radio button
//def customB_val= customB.getValue() as String
if (customB_vall == "Yes"){
customA.setRequired(true)
}
Would anyone have any idea what i'm doing wrong as i can't figure it out. Or perhaps this functionality is not possible on the create issue screen
This is absolutely possible.
I see some typos in your script.
Try like this:
def customA= getFieldById("customfield_16191") // regular select custom field
def customB= getFieldById("customfield_14200") //radio button
customA.setRequired(customB.value == "Yes")
Make sure this script is installed on the customB field so that it is executed with each change of value the radio button.
Ah it should have been:
def customA= getFieldById("customfield_16191") // regular select custom field
def customB= getFieldById("customfield_14200") //radio button
def customB_val= customB.getValue() as String
if (customB_val == "Yes"){
customA.setRequired(true)
}
My script works, it was just that I had set it on the select custom field and not the radio button. But I would prefer using the script you provided as it was smoother upon execution. I could select and de-select the radio button as many times and it would be required or not required accordingly. Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.