Regular Expression Check (JSU)

Sandy Xiong September 20, 2022

Hello,

 

Im trying to add a validator with alert message pop up if storypoint is not within the Fibonacci Sequence. However, the below code is appearing to alert for all numbers. Please assist with the below?

  • Regular expression: Option [1,2,3,5,8,13,21,34,55,89,144Story Point.JPG

1 answer

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2022

You could try this regular expression, I used a version of it way back in the days when I did a lot of Perl scripting:

(?x) .? | ( \\2?+ (\\1|^.) )* ..

For an explanation of it, check out this post

Sandy Xiong September 21, 2022

@Mikael Sandberg Thank you for your response! 

I have just try this script and it doesnt seem to be working. The alert appears to be stopping only 2 digits number. However, our end goal is to stop the user from entering in any numbers that not within the given option of  (1,2,3,5,8,13,21,34,55,89,144)

Any other ideas?

Sandy Xiong September 21, 2022

@Mikael Sandberg Okay i think i got this to work. However do you know if Jira will allow us to put this into Prod at a specific date? Example, if i want to implement this script next week and anything before next week does not need to follow this rule.

Like Mikael Sandberg likes this
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2022

i guess you could if you have an app that allows you to add scripts to the workflow that checks when the issue was created, but that seems to be a lot of work to get it working. Your other option would be to create a new issue type with a new workflow and "retire" the existing issue type, but if it was my environment I would not recommend it.

Suggest an answer

Log in or Sign up to answer