Hi All,
I have a checkbox field call ENV with the values = NonProd, Stage, Prod.
If anyone selected Prod or Stage from the list we need to make the Security field required.
Here is the code I tried and wont work if I select multiple values in the ENV field, please let me know if anything I can modify in this.
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
def RE = getFieldById("customfield_14200")
def SF = getFieldById("customfield_14217")
def RE1 = RE.value.toString()
if (RE1 in ["Prod" , "Stage"] {
SF.setRequired(true)
}
else {
SF.setRequired(false)
}
Jira Server 7.12.3
Scriptrunner version 5.4.45
TIA!!