The Regex Field Validation allow form creators to enforce input rules for different form elements. These rules help maintain data accuracy, prevent errors, and guide users by displaying helpful validation messages.
Navigate to Form Builder:
Open the form builder in Smart Forms for Jira.
Add or select a Single-Line Text Input or Attachment field.
Enter Regex Pattern:
Input a valid regex pattern in the Regex pattern field.
Examples:
Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
PDF file format (for attachments): /\.pdf$/i
For text input fields, you can set Minimum characters and Maximum characters limits.
Input Validation Rules:
Minimum Characters: No min characters
Maximum Characters: No max characters
Default Error Messages:
Must be more than or equal to [min] characters.
Must be less than or equal to [max] characters.
Define Error Message:
Provide a custom error message in the Regex error message field.
Example: Invalid email format. Please use "example@domain.com".
Select Multi-Choice or Checkbox Field:
In the form builder, choose a Multi-Choice or Checkbox field.
Set Minimum and Maximum Choices:
Define Minimum number of choices and Maximum number of choices.
Leave blank or enter "No min choices" and "No max choices" for unlimited selections.
Error Message Configuration:
Default messages include:
Must be more than or equal to [min] choices.
Must be less than or equal to [max] choices.
Must be between [min] and [max] choices.
Select Numeric Field:
Add or select a Numeric field in your form.
Define Numeric Range:
Enter values in Minimum number and Maximum number fields.
Leave blank or enter "No min number" and "No max number" if no limits are required.
Error Message Configuration:
Default messages:
Must be more than or equal to [min].
Must be less than or equal to [max].
Must be between [min] and [max].
The field will show the custom error message you defined, prompting the user to correct their input.
Yes, regex validation applies only when the user fills out the field.
By default, regex patterns are case-sensitive. To make them case-insensitive, use the i
flag (e.g., /pattern/i
).
Regex: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Example Input: user@example.com
Description: Ensures the input is a valid email address.
Regex: ^\+?[1-9]\d{1,14}$
Example Input: +1234567890
Description: Validates international phone numbers using the E.164 format.
Regex: ^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$
Example Input: (123) 456-7890
Description: Accepts US phone numbers with optional separators like dashes, dots, or spaces.
Regex: ^\d{5}(-\d{4})?$
Example Input: 12345
or 12345-6789
Description: Matches standard US ZIP codes with an optional four-digit extension.
Regex: ^[A-Z]+-\d+$
Example Input: DEV-123
Use Case: Ensures that input follows the Jira issue key format used in bug tracking and project management.
Regex: ^INV-\d{6}$
Example Input: INV-202345
Use Case: Ensures invoice numbers follow a standardized format.
Regex: ^\d{3}-\d{2}-\d{4}$
Example Input: 123-45-6789
Use Case: Validates social security numbers for compliance.
Regex: ^\d{2}-\d{7}$
Example Input: 12-3456789
Use Case: Ensures tax IDs are formatted correctly.