How to use regex to set validation for a number input on a form field

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

Summary

The minimum and maximum field attributes designed in the number type field in Jira forms take into account the number of digits and not the numerical values. If you add the minimum as 3 then the values accepted are 111, 121, 133 etc.

This article explains how you create a field to input a number within a specific range or a specific format using regex validation.

Environment

Jira Service Management Cloud

Diagnosis

The number field defines the minimum and maximum number of digits and not values. Additionally, there is no option to add an additional validator or an error message.

(Auto-migrated image: description temporarily unavailable)

Output:

(Auto-migrated image: description temporarily unavailable)

Solution

You can use a short text or long text field to input the number value. Furthermore, use regex to limit the range or if you like the format in a specific pattern. Additionally, you can add an error message to be displayed for wrong values added.

So for 1-8 numbers try ^[0-9]{1,8}$ and you can even specify an error message.

(Auto-migrated image: description temporarily unavailable)

Reference Article:Regex validation

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.