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?

Thanks,

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
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 Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

47 views 0 4
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