Whenever we are entering the number in the number field automatically comma is added


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

We're seeing commas being inserted for data in a Number field in Jira, and depending on situation at times we're looking to remove those commas as those could be an AD account or a phone number and because of commas we might get error while running the API calls.

Diagnosis

Commas are automatically added as Thousands Separators when displaying a Custom Field with a Type of Number Field.

Cause

At this time, commas in Number fields is hardcoded in Jira Cloud and cannot be disabled. We do have an open Suggestion request which has an interest in altering this behavior.

Solution

One option we might consider as a workaround would be to utilize a text field in our project instead of a number field. Text fields don't automatically add commas to numbers of 4 digits or more, which would correct the display issue we're addressing here.
Although this isn't possible natively, we have a workaround in place using the regular expression validator through the workflows, which is explained in detail in the article Regular Expression validator.

Using below regex value within a Workflow validator will ensure the custom field accepts only whole numbers and could vary from a single digit to a seven digit i.e (1-9999999). We can adjust the regex value according to our needs:

^([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9][0-9])$

Screenshot from the workflow validator:

Screenshot from the workflow validator:

Last modified on Aug 30, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.