script runner validation

I am trying to check if a comment is entered if a radio buttons is set to Yes in a simple script validator

cfValues['Will the overnight batch be affected']?.value != 'Yes' || cfValues['Effect on Batch?']

when No it transitions

when yes i get error pop up workflow error "It seems that you have tried to perform an illegal workflow operation."

i guess its because validator is now returning false,

how do i get an error message against field

JIRA 6.2.7

ScriptRunner 3.0.2

4 answers

Sorry I misunderstood the question. I suppose now you do not have a screen during the transition. So the solution is to associate a screen during the transition and then make sure that you set to display the error message in a field that exists in the screen that you just configured. Please let me know if you need further assisatnse 

yes that works - thanks!

I assumed the errors would be reported on the screen starting the transition

correction - ScriptRunner 3.0.7

I would suggest to use 'if' cases in order to test them, and then you can convert them easier to logical expressions more information on groovy truth.

Hi Thanos

If i just 'return false' i get the workflow error pop-up instead of the configured field error message

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published 8 hours ago in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

177 views 3 12
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot