Hi, i want to validate story point with regex, users only can choose 1,2,3,5,8,13,21 i write this /^(1|2|3|5|8|13|21)$/   but not working, get this error

 

Field Story Points with actual value '5.0' does not match regular expression /^(1|2|3|5|8|13|21)$/ 

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
April 4, 2024

Hi @ნოდარ ვარდიაშვილი_ Nodar_Vardiashvili_space_ge 

Where are you trying to perform this validation with the regular expression?  For example, in custom code you wrote, an automation rule, etc.

Have you tried to floor or format the story point value before performing the comparison?

Kind regards,
Bill

Hi, I am trying it in workflow, add this validation on issue create transition

Bill Sheboy
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.
April 5, 2024

Thanks for that information.  Please try this expression:

((1|2|3|5|8|13|21)(\.0))

 

Like Bill Sheboy likes this
0 votes
Gustav Lindskog April 2, 2024

Hi there!

To make your regex work for both whole numbers and floating-point numbers, you can modify it to allow for optional decimal points and trailing zeros. Here's the modified version which you can try out instead:

  • /^(1|2|3|5|8|13|21)(\.0)?$/gm

Let me know if it works! ;)

/G

Hi, same problem 

Field Story Points with actual value '3.0' does not match regular expression /^(1|2|3|5|8|13|21)(\.0)?$/gm

 

I try to add 3 in story points but get this error

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events