How to use simple validator in scriptrunner?


I wanna use a simple scripted validator using by scriptrunner plugin

So I tried to do below:


if( == "Fixed") {
cfValues['FIELD1)']?.values()*.value.size() == 1
cfValues['FIELD2']?.values()*.value.size() == 1
if( == "Postpone"){
cfValues['FIELD3']?.values()*.value.size() == 2
cfValues['FIELD4]?.values()*.value.size() == 2


However it was not working

I don't know how to use it..


please tell me how to use it 


thanks you ahead

1 answer

0 vote

What do you want it to do?

At a guess I'm assuming you want that if resolution is Fixed you want a single option selected for those other fields. In which case you want something like:

if( == "Fixed") {
    return cfValues['FIELD1)']?.values().size() == 1 &&
        cfValues['FIELD2']?.values().size() == 1

if( == "Postpone"){
    return cfValues['FIELD3']?.values().size() == 2 && 
        cfValues['FIELD4']?.values().size() == 2

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

361 views 0 6
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