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

1 vote

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
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
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

767 views 2 19
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