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")
According to this scenario it seems like it takes in consideration only the values that was saved before opening the edit screen: 1. Create issue. (fields are not required even if I check the "MDD Product" flag). However, let's say we don't check any of the flags at this stage. 2. Edit issue, checking MDD Product flag. This should imply that death and has-fields should be required. However the fields are not required when saving issue. 3. Edit issue again. Try to save it - death- and has-fields now get required as intended. (MDD Product field has previously been saved with checked value). Maybe I'm using the script in a way not intended ?
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG