In Jira How to create Custom field with Number data type and assign specefic field length

Do you have any custom field type(number) where i can assign Field length?
I want to create new cusom field with NUMBER type and assign field length as 10

4 answers

0 votes

You can't define this without some workarounds. There are 2 options I can think of.

1. Add some Javascript in the field description that will limit the length to 10.

2. Modify the number velocity templates in the server to limit this. If you do this, that will be globally changed. This needs to be updated whenever the JIRA is upgraded.

Third option is to write a plugin to provide your own custom-field-type - that would be similar to Jobin's option 2, but isolated from the other fields and a discrete package (you'd need to worry about upgrading it when Jira is upgraded, but it wouldn't be in the core of Jira)

Is there any possible to extend the length of number filed, such 20 bits?

It already allows vastly more than 20 bits. I'm not sure what you're asking for here.

Thanks for your reply.

I am getting following error when i add java script in the DESCRIPTION FIELD on ACTUAL Customer filed

org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][id,16853][issue,19904][numbervalue,1.2345678901234E13][parentkey,null][customfield,10051] (SQL Exception while executing the following:INSERT INTO jiraschemaqa44.customfieldvalue (ID, ISSUE, CUSTOMFIELD, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation))

Added following Java script that in ACTUAL custom field DESCRIPTION, My custom filed type is NUMBER

<script type="text/javascript">
descField = document.getElementById('Actual');
if (descField.value.length > 10){
alert("can only have 10 digits");

This can't be related to the javascript you added...

When i add number below 10 degits to ACTUAL HOURS custom field it is taking, i get this error when i put more than 10 degits.

Please help me to fix this problem


You're probably treating them as strings or something, use parseInt()

Nothign is working.

I dont think my java script is executing when i put the value in the custom field. DO i have to download any plugin or ENABLE JAVA SCRIPT in the jira console to make this java script working?

Please help me to fix this problem.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,305 views 5 11
Read article

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