Using Scriptrunner, I'm looking to add a validator on the creation of a ticket that specifies if a certain component field is selected, then another field cannot be null or 'None'.
I was advised with the following:
issue.getComponents()*.name == 'ComponentValueA' && cfValues['Field A']?.value != null
If I understand the above statement, it's saying that components is equal to "ComponentValueA" and the custom field "Field A" is not null.
The script is then supposed to check if the above statement is true and only error if it's false. Unfortunately, it seems to always error.
I've tried to switch the null to "None" as that's the default value of "Field A" and attempted to treat components as a custom field but bother gave the incorrect results.