I can't get my behaviours validation script to work when creating transition. It validates fields fine when performing edit on an issue, but on creation it does not take any effect.
(the logic is that if either of the three fields (medicaldevice, exflag, mddProduct) is set to true, the two other fields should be required.)
def medicalSite = getFieldByName("Medical Device Site").getValue()
def exFlag = getFieldByName("Ex Product Flag").getValue()
def mddProduct = getFieldByName("MDD Product Flag").getValue()
def deathField = getFieldByName("Did the event lead to or could have lead to death or serious injury")
def hasField = getFieldByName("Has an identifiable event happened")
if (medicalSite == "true" || exFlag == "true" || mddProduct == "true")
{
deathField.setRequired(true)
hasField.setRequired(true)
}