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

This widget could not be displayed.

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

This widget could not be displayed.

correction - ScriptRunner 3.0.7

This widget could not be displayed.

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.

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 7 hours ago in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

25 views 0 2
Join discussion

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