How to limit the number of digits in a custom field

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

As an administrator, you may want to limit the number of digits that can be entered in a custom field for an issue type.

Environment

Jira Cloud / Jira Service Management Cloud

Solution

This solution only works for

text fields

and

not number fields

. If you require a solution for a number field, you may need to consider a third-party

add-on

 or custom development.

You can utilize a workflow validator with RegEx to achieve it. The step-by-step process is given below:

  1. Go to Project settings > Workflows of the desired project

  2. Find the required workflow and click on the Edit (pencil) icon under the Actions column

  3. Click on the Diagram view and select the required transition (For example, Create transition)

  4. Under Options, clickonValidators

  5. Click on the Add validator button, select theRegular Expression Check option, and click the 'Add' button

  6. For Field to validate:, select the text custom field that needs to be validated from the drop-down menu

  7. For Regular expression: column, add the expression in the format [Range of numbers]{Number of digits}. For example, to limit the number of digits in the custom field to 5 (i.e. the numbers varying from 00000-99999), use [0-9]{5}

(Auto-migrated image: description temporarily unavailable)

8. Click the 'Add' button

9. Click on Publish Draft > Publish to save the changes to the workflow. If you want, you can save a backup copy of the current workflow by selecting Yes in Save a backup copy?

Adding the above sample regular expression to the workflow validator will limit the number of digits entered into the custom field to 5. If a user enters a number that is more/less than 5 digits to this custom field, they will receive an error message and be prompted to enter a valid number.

(Auto-migrated image: description temporarily unavailable)

For more information about workflow, please visit Configure advanced issue workflows.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.