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?
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.
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
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.