Number Field (remove . value) - How?

Hi guys,

So I have a number field and I want to remove the decimal value since this field will only be whole values. How do I do that? When the field is merged into an email that is sent it will display 2.0 instead of 2 that I entered.

Now I read this page
https://community.atlassian.com/t5/Jira-questions/Remove-decimal-points-when-adding-Number-Field-to-summary/qaq-p/229142

And I found this

issue.summary = issue.summary.replaceAll("\\.0")

But I have no idea where to input this or if this is the best solution? I am a newbie learning Jira so detailed instruction on how to solve this would be appreciated.

1 answer

0 votes
Josh Steckler Community Champion Oct 12, 2017

That bit of code there only works if you have Script Runner.

You could use a regular expression workflow validator, but that would not help you for when users use the Edit screen or inline editing.

https://confluence.atlassian.com/jirakb/using-workflow-regular-expression-check-validator-to-restrict-text-field-in-number-format-859509784.html

A regular expression to match only integers could be as follows: 

^[0-9]*$

Hi @Josh Steckler appreciate your reply.

But can I use your answer? Because if edited it will not work or what?

Does following mean that highest value is 9? Or it just removes the decimal?

^[0-9]*$

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,089 views 13 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot