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 Bandarupalli Sai likes this
Like Bill Sheboy likes this
Bandarupalli Sai
Contributor
September 17, 2024

@Bill Sheboy - As per the above regex expression, we can't use the floating number in Story Points field. Can you please confirm the regex expression to include floating number in Story Points field?

Thanks in advance!

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.
September 17, 2024

Hi @Bandarupalli Sai 

First thing, as this is an older thread I recommend creating a new question, perhaps with a link back to this one.  That will ensure the maximum number of people see it to offer suggestions.

Back to your question...

What problem are you trying to solve?

What do you mean by "we can't use the floating number in Story Points field"?

The Story Points field displays integers in the UX, and it returns integers with the REST API, but non-integers in automation rules.

Kind regards,
Bill

Bandarupalli Sai
Contributor
September 30, 2024

Thank you, I was able to figure it out. 

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
Product Admin
TAGS
AUG Leaders

Atlassian Community Events