I set up a behaviour to make a field mandatory when another field is set to a certain value. The behaviour works, but I need to switch issuetype back and forth for the required condition to update.
This is my server side script:
"
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
def field1 = getFieldByName("Field 1")
def field2 = getFieldByName("Field 2")
if (field1.getValue() == "Value 1") {
field2.setRequired(true)
} else {
field2.setRequired(false)
}
"
I tried to set it to run on Workflow Action:Create (1) and without, but does not change anything. Not sure what I'm missing?