Workflow Validator for Jira Cloud not working as expected

Enric Márquez March 25, 2024

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;transition screen.png

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

 

1 answer

0 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2024

Hi @Enric Márquez , thanks for your question.

Typically the vendors are the best placed to offer this kind of advice. Have you checked the documentation https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/validators  or opened a ticket with Adaptavist - https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=cloud&tab=support ?

They should be able to help.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events