Script runner help

Hi All,

I want to do regular expression validator check on one of the custom label field through script runner plugin. I'm following below steps,

  • Adding a validator on a transition.
  • Selecting Simple scripted validator
  • Adding a condition: cfValues['Field Name'] ==~ /\d{4}\-\w{8}/ -> [ie, this custom field should be filled with the format like "any four digit-any 8 characters"]

but this is not working for me. Please suggest what modification need to do?


Sanu P Soman 


3 answers

1 accepted

For labels custom fields try this:

cfValues['Labels Custom field']*.label.every { it ==~ /\d{4}\-\w{8}/ }

Thanks a lot Jamie :-)

Any suggestions?

Below code is working for 255 character text custom field but not working for custom label field. Please suggest any additional settings need to do for this? cfValues['Text Custom field'] ==~ /\d{4}\-\w{8}/

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,383 views 15 19
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