JIRA Server 6.3.10 ScriptRunner 22.214.171.124
We wanted to do a simple script validation for the following
1) if the value of a multi-select field FieldMS is 'Yes' then a single select field FieldSS cannot be empty
2) if the value of a multi-select field FieldMS is 'Yes' then another multi select field FieldOMS cannot be empty
for point 1 - !cfValues['FieldMS']*.value.contains("Yes") || cfValues['FieldSS']
for point 2 - !cfValues['FieldMS']*.value.contains("Yes") || cfValues['FieldOMS']
It works if value 'Yes' is chosen and dependent field is empty but unfortunately even if the FieldMS is empty validations are triggered which should not be the case.
!('Yes' in cfValues['FieldMS']*.value) || cfValues['FieldSS'] but not working.
if (cfValues['FieldMS']*.value == ["Yes"] && ! cfValues['FieldSS']?.value) return false return true
So the above validator means:
If the FieldMS value IS Yes then if the FieldSS has no value selected then fail. In any other case, for example if FieldMS CONTAINS Yes and Maybe values and the FieldSS has no value selected then pass.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
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
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs