Good afternoon people,
I am trying to create a workflow validator for a transition screen in Jira Cloud, using Script Runner Workflow Validator.
The goal is to create a validator that checks that the value filled in customfield_10111 (Notify To) is present in the list of values included in customfield_10002(Organizations) and if that is not the case then show a warning message and not allow the action of "assign to stakeholder"
Here a screenshot of the transition screen fields to evaluate;
customfield_10002 is a organizations type, and customfield_10111 is a group picker (multiple groups) type.
Taking all this into consideration and from info in google regarding Jira expressions I managed to build this;
(issue.fields.customfield_10002.organizations || []).organizations.some(org => org.name == issue.fields.customfield_10111)
But it keeps throwing the warning message at me even though if the value in Notify To is present in Organizations field,
Could you be so kind to let me know where my mistake might be?
best regards,
Enric