Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Remove Commas from Custom field (Number type)

We have a customer # field that is a single line text field (customfield_10637) because some customers are Alpha Numeric where others are just numeric.

In the case of numeric customer #'s we are coping those over to a number type custom field (customfield_10768) .  We are doing this as in some cases Customer A may be entered as 001234567 or 0001234567 in the text field which would require the team to search both scenarios.

When we copy the field over to the number field, this allows all results to be returned with one search.  On the display of the issue though, the number field contains commas which really isn't accurate.  

When i use the .format("######") option, it actually just clears my number field.  When i remove the format option,  it copies the field values but includes the commas.

Is there a way i can remove the commas from the number field so its shows just the accurate customer #?  I have also tried, to first copy with the commas, refetch the data and edit the customfield_10768 a second time and reformat it again but same results of it clearing the field.

Here is my automation rule:

customer#_automationRule.jpg

here are the results when i do not use the format option

commas_customer#.jpg

2 answers

Hi @Julian 

Rather than a number field, have you considered using a text field for account number, and remove leading zeroes, when needed...for example with a regular expression?

Best regards,
Bill

Thanks for the reply, the reason for the number field is the automatic stripping of leading zero's.  In some cases we can have up to 10 leading zero's but i can test creating a new text field and using regex to strip them.  Im not sure if its the case where we need a scenario for each amount of leading zero, i.e. one if statement for one leading zero all the way to 10 leading zero's. 

I'll give it a test, but was hoping to format the number field would be ideal in this scenario. 

Like Bill Sheboy likes this
1 vote
bmccoy Atlassian Team Jul 13, 2021

Hi,

I don't believe you can remove the commas from the number field.   This is just the way the number custom fields are rendered in Jira.  (Though there may be a locale-related setting somewhere,  but it would be per user).

I would probably go what Bill said, and just use a text field,  but reformat the data to remove the zeros.

{{issue.customfield_33333.asNumber}} might be enough to strip the zeros. 

Or,  you could try  {{issue.customfield_33333.asNumber.format("#######")}}.  The "asNumber" is probably be the missing piece of in your original smart value.

Cheers,
Brydie

Thanks @bmccoy  the asNumber was the trick to get it copy properly with the format, commas are still present but its not clearing my field.  I think the text field is probably the only option for my scenario. 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

931 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you