Forums

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

How to format a custom numeric field - Jira service Management

J Roberts February 6, 2021

When the customer creates a request and enters a value in a custom numeric amount field, I would like to ensure the value presents with a decimal followed by 2 digits. I tried to edit the value with an edit field automation issue.amount.format(###,###,###.##) but that did not work. If the user enters 100 I would like to present 100.00 after the issue request is saved or even format the field after they move to the next field. Any suggestions? Thank you.

1 answer

0 votes
Joseph Chung Yin
Community Champion
February 7, 2021

@J Roberts -

In Jira, the number format field should already default with 2 decimal.  I would recommend you to verify if your custom field was associate with the Number Field format type or not.

2021-02-07_16-24-32.png

If it is created using the Number Field format type, it will always carries the 2 decimal points (i.e. Entered 100, it will display as 100.00).

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

J Roberts February 9, 2021

My custom field was created as a number. Testing to see the actual value stored returns 90.0 {{issue.customfield_10064}}, however the value displayed in the portal and agent view is 90

I would like the displayed value to be 90.0 and not simply 90

Joseph Chung Yin
Community Champion
February 9, 2021

@J Roberts -

Hi Jackie:

After further analysis on my end, it looks like you will have to adjust a configuration (.vm) file for your Jira system to achieve what you wanted.

Take a look at the following posting - https://confluence.atlassian.com/jirakb/how-to-display-a-different-format-for-the-number-customfield-658735503.html

Hope this helps.

Best, Joseph

llewis
Contributor
January 23, 2025

Hi

 

I have a customised field that is a number field type but it's shows 4 decimals points instead of 2.

 

So, how can I change to only show 2 decimal points?

Joseph Chung Yin
Community Champion
January 23, 2025

@llewis 

It is interesting that the system allows showing of 4 decimals points based on my knowledge.  It is because by default a number data type field in Jira/JSM is always default with 2 decimal points.

Take a look at this community posting where another community leader offered some advises although it may not addressing your exact ask -

https://community.atlassian.com/t5/Jira-questions/How-to-format-the-custom-number-field/qaq-p/2569814

Sorry.

Best, Joseph Chung Yin

llewis
Contributor
January 23, 2025

Thanks @Joseph Chung Yin 

J Roberts January 23, 2025

@llewis Hello,

Try {{issue.<field name>.format(".##")}} 

llewis
Contributor
January 23, 2025

Hi @J Roberts  - ok but where do I put that text?  as I have looked and there is no place to add text or change the decimal point.

J Roberts January 24, 2025

Hello @llewis , try adding the text to the edit issue automation.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events