How to display a different format for the Number customfield

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Important supportability disclaimer!

Customizations like these are not supported by Atlassian (in any support offer) and should be used at the Jira Admins' own discretion and risk.

You may find support from fellow users in the Community or through the services provided by Atlassian Solution Partners. This article only offers some best practices should you really need to implement something like this.

On version upgrades

Also keep in mind that the next time you upgrade JIRA – or need a new installation for any reason – you will have to manually copy any changes you have made to the tempates into the new installation of JIRA. If the JSPs or templates have changed in the newer version, you will have to port your customization into them.

This means you should include tests on your upgrade checklist to make sure the customizations you may have applied through custom Javascript still work in the new version you're upgrading to.


Summary

If you do not like how the Number custom field is displaying in Jira Data Center (for example, if you do not want it to display the commas), you can modify a velocity file to configure this. Velocity is the templating engine used in Jira.


Modify Jira to use custom Velocity templates

If you wish to change JIRA's behaviour by modifying the JSPs or Velocity templates, you can do so simply by changing files in the JIRA distribution.

  1. Shutdown Jira
  2. Do a safety backup of the content of <jira-application-dir>/WEB-INF/classes/templates/plugins/fields/view
  3. Look for <jira-application-dir>/WEB-INF/classes/templates/plugins/fields/view/view-number.vm 
  4. Replace $!numberTool.format($value) with $value.longValue()

  5. Start Jira


Last modified on Mar 6, 2024

Was this helpful?

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