Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script runner help

Sanu Soman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2015

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
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2015

For labels custom fields try this:

cfValues['Labels Custom field']*.label.every { it ==~ /\d{4}\-\w{8}/ }
Sanu Soman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2015

Thanks a lot Jamie :-)

0 votes
Sanu Soman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2015

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}/

0 votes
Sanu Soman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2015

Any suggestions?

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events