Forums

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

Restrict a numeric field to use only number without a dot "."

rangel de oliveira machado
Contributor
February 18, 2022

Good Morning!

I have a field of type "Number Field" in jira service management for the requester to inform the phone number. However, the field puts (.) in the middle of the numbers. I need to somehow remove that "." or restrict the field to use only numbers.

Does anyone know how to configure this?

Do you have any Post-Functions, Validators or Properties in the "Create" transition of the workflow?

1 answer

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
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 18, 2022

Number fields render numbers in a human-friendly format, and although you can turn off your regional separator globally for every number field, you're going to have other problems with the numbers in there.

None of my telephone numbers can be stored or shown as a number.  You need a leading 0 in the UK, but the display of a number always drops leading zeroes because they don't matter in a number.   My international numbers start +44(0)91... and +() are not numbers. 

Telephone numbers are not numbers.  You should be storing them in a short text field.

If it helps, if you looked in the database, you'd see that the data being stored is a number.  The separator you are seeing is a display thing, not actually part of your data!

rangel de oliveira machado
Contributor
February 20, 2022

Thanks for the answer.

Is there a way to configure the short text field to accept only numbers?

Nic Brough -Adaptavist-
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 20, 2022

I'm sorry, but you can't do that without apps that can check and interfere with your input.  

I would look in the marketplace for apps that can do validation like that (you know I'm going to yell "scriptrunner" because I'm an Adaptavist, but there are a lot of others that can do it).  Off the shelf, no, Jira does not validate text fields, but you do have some options.  I'd guess looking for "regular expressions" might be your best best - they're a lot more powerful than people think, and can certainly restrict your 'phoone field to [0-9()+] without dropping leading zeroes.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events