Trying to make a field required when a prior field is populated. We dont use the behaviours plug-in. The first field is a multi-select and I have a saved issue with 1 of the 3 values selected. The field is customfield_14523, the value is 15300 and the field label is Production.
Per https://answers.atlassian.com/questions/103549/validate-multi-select-customfield-in-transition
I'm trying this command using Workflow Validator Built-in script
cfValues['customfield_14523']*.value.contains("15300") && cfValues["customfield_14807"]*.value == ("")
After failing, I thought I'd test the first half of the script with Script Runner and the saved issue.
Go into Script Runner, enter the key of the issue, give it this command:
cfValues['customfield_14523']*.value.contains("15300")
false, get this...javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method contains() on null object...
The multi-select object isn't null, it has a value...15300, viewable in firebug with a label of "Production"
I also tried ? instead of *...Production instead of "15300", double quotes, single quotes...fail.
Javascript doesn't seem to like multi-selects either.
Please advise!