Forums

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

How to create % custom field in Jira?

Bunty
Contributor
November 19, 2018

Hello All,

Any idea on how to create a number custom filed with %.

For Example - Custom field should accept only numbers with a percentage symbol(100%). It shouldn't allow the user to create the custom field with string.

Any help would be appreciated??

Thanks,

Manikanta.

2 answers

0 votes
LarryBrock
Community Champion
November 27, 2018

Hello @Bunty!

Great news, Nic suggested writing your own add-on but that's not necessary.  Turbo Kit for Jira has a "Regex Validated Single Line Text Field" custom field so you can enforce just about any kind of input desired, including a percentage.  You can find information about TK4J in the Atlassian marketplace.

(Full disclosure:  I work for the company that wrote TK4J, Praecipio Consulting.)

Hope this helps,
~~Larry Brock

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2018

You will need to write an add-on to provide this if you want to do it properly.

Otherwise, you could use a text field and then wrap some "Behaviours" around it to validate the entry is good.  But Behaviours can't stop people getting it wrong in several places, so you'd also need a listener to catch changes to the field, validate them and then re-edit the issue to undo them (which will annoy your users)

However, there's a reason a % field is not built into Jira - it's very rare that you actually want to enter it.  Almost every use case is that the % should be calculated from something else.  This is where Scriptrunner scripted fields would kick in - you'd write the calculation in there and they'll display the %.

Suggest an answer

Log in or Sign up to answer