Hello,
Here i need custom field required based on another custom field value.
Required custom field is Appear (Text field multi line)
Based custom field is Popular (radio buttons)
In Popular field if we select 'YES' then Appear field should be required field and we are using script runner addon (server) can any one please help me with the script and i'm new to script runner. Please help me how to achieve this script.
Thanks,
Siva
Here the answer for above question
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def AppearField = getFieldById(getFieldChanged())
def regressedVersionField = getFieldByName("Popular")
String AppearValue = AppearField.getValue()
if (AppearValue == "Yes") {
regressedVersionField.setRequired(true)
} else {
regressedVersionField.setRequired(false)
regressedVersionField.setAllowInlineEdit(true)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.