Forums

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

Accepting only Whole Numbers in a Numeric Field in JIRA CLOUD

Rinjini Poddar March 1, 2023

Hello team,

We want to restrict the numeric custom fields in JIRA to accept only whole numbers.

How can we achieve this in Jira Cloud?

2 answers

2 accepted

1 vote
Answer accepted
Danny
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.
March 1, 2023

Hi @Rinjini Poddar

Unfortunately, I have not been able to find a solution to your custom field requirement in Jira using no add-ons. 

However, if the field in question is only editable on a workflow transition, such as the point the issue type was created, you could add a Workflow Validator on a transition step to check that the numerical custom field value added was a whole number. You would do this by adding a regular expression Validator against the custom field for Jira to check against. Though the error message when this does check is not very user friendly. 

regex.png

There is a feature request currently gathering interest for this field configuration. My recommendation would be to vote on the feature request though it is unknown when Atlassian would consider the feature request. 

Hope this helps,

Danny

Danny
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.
March 6, 2023

@Rinjini Poddar let me know how you got on. Trudy has some great options using add-ons that would most likely give a better user experience. 

1 vote
Answer accepted
Trudy Claspill
Community Champion
March 1, 2023

Hello @Rinjini Poddar 

If the value can be edited only during a workflow transition, you could check that it was an integer using the third party app Adaptavist Scriptrunner and adding a Scripted Validator.

This post gives an example of that for Jira Server/DC:

https://community.atlassian.com/t5/Jira-questions/How-to-restrict-existing-number-field-to-accept-only-integers/qaq-p/1754116

There may be other third party apps that would also support something like this.

 

Another work around is to use an Automation Rule to check the field when the value is changed. This won't prevent the entry of a non-integer value, but the could automate updating the field to drop decimal values or send an email to somebody to alert them that it needs to be fixed.

 

And I see that Atlassian has a request in their backlog to support creating an integers-only custom field.

https://jira.atlassian.com/browse/JRACLOUD-34033

 

You might also find third party apps that are already available that would enable you to add an integers-only custom field:

https://marketplace.atlassian.com/search?hosting=cloud&product=jira&query=custom%20fields

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events