Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Validation based on regular expression never actually validates against regex


I'm trying to build a validation that would check for SSNs in a string (summary field) and display an error message if found. Using the Validation based on Regular Expression from JWT never really displays the error.


My setup is currently as follows:

On Create transition: Validation:

Screenshot 2022-04-27 080451.jpg


Nothing really happens if I create a ticket with the summary of "test 123456789" or just "test", it always gets created. 

I've tested my regex against two different regex parsers (, and and both can detect the 123456789 if added to the string and detect nothing if the 9 digits are not there.


I've tried also creating a custom validator script using script runner, but that had the opposite problem of always raising an error regardless of if the regex was met or not.

Code I've tried is below:

def val = issue.getSummary() as String

if (!val.matches(/((?!666|000|9\d{2})\d{3}-(?!00)\d{2}-(?!0{4})\d{4})|((?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4})/)) {
} else {

 The above code always validates to false and never allows me to create an issue.


Another iteration is below:

import java.util.regex.Pattern;

private boolean isValid(String value) {
final String REGEX = /((?!666|000|9\d{2})\d{3}-(?!00)\d{2}-(?!0{4})\d{4})|((?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4})/;

final Pattern PATTERN = Pattern.compile(REGEX);

return PATTERN.matcher(value).matches();


 Again always validates to false

(N.B.: I used the simple scripted validator for the above two codes)

Any help or guidance to what I'm doing incorrectly would be greatly appreciated!

1 answer

1 accepted

Hi @Pierre Ibrahim ,

Thank you for your request!

In order to achieve that functionality, you can use a Logical Validator from Jira Workflow Toolbox. This is the expression you should use in that Logical Validator:

count(findPattern(%{issue.summary}, "((?!666|000|9\\d{2})\\d{3}-(?!00)\\d{2}-(?!0{4})\\d{4})|((?!666|000|9\\d{2})\\d{3}(?!00)\\d{2}(?!0{4})\\d{4})")) = 0

This expression will cancel the transition from being executed if any SSNs appear in the summary.

The functions used in the expression are count and findPattern(click on the names to access to the internal documentation of those functions, including some examples)

Please, let me know if the provided solution worked as expected. If you have any other doubt, I will gladly help you! :)

Thank you.

Best regards,

Thank you so much @Sergio García-Consuegra _Decadis AG_ ! This worked perfectly! and even allows for expansion to other issue fields which is something else I needed to resolve for!

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events