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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

29 views 0 10
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