regex
Overview
The regex function enables you to perform pattern matching on field values using regular expressions. This is useful for finding issues based on complex text patterns in fields like summary, description, or custom text fields.
Syntax
issue in regex("subquery", "field", "pattern")
Parameters
- subquery (required): A valid JQL query that defines the set of issues to evaluate
- field (required): The name of the field to search in
- pattern (required): A valid regular expression pattern
Supported Operators
in- issues where field matches the patternnot in- issues where field does not match the pattern
Examples
Finding issues with version numbers in summary
issue in regex("project = SER", "summary", "v[0-9]+[.][0-9]+[.][0-9]+")
Matches summaries like "v1.2.3", "Release v1.2.3 is ready".
Finding issues with exact version number match
issue in regex("project = SER", "summary", "^v[0-9]+[.][0-9]+[.][0-9]+$")
Only matches summaries that are exactly a version number like "v1.2.3".
Finding issues with email addresses in description
issue in regex("project = SER", "description", "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+[.][a-zA-Z]{2,}")
Finding issues with specific date format in a custom field
issue in regex("project = SER", "Approvers", "[0-9]{2}/[0-9]{2}/[0-9]{4}")
Finding issues without numbers in summary
issue not in regex("project = SER", "summary", "[0-9]")
Finding issues with specific error codes
issue in regex("project = SER", "description", "ERROR-[A-Z]{2}[0-9]{4}")
Supported Field Types
The regex function works with:
- Text fields (Summary, Description)
- Custom text fields
- Status, Priority, Labels, Issue types
- Other text-based fields
For custom fields, use the field's display name (e.g., "Story Points" instead of "customfield_10001").
The function automatically handles Atlassian Document Format (ADF) fields by extracting plain text for pattern matching.
Regular Expression Syntax
Character Classes
- Use
[0-9]instead of\dfor digits - Use
[.]instead of\.for literal dots - Character classes like
[a-z],[A-Z],[^abc]work as expected
Quantifiers
*(zero or more)+(one or more)?(zero or one){n}(exactly n times){n,}(n or more times){n,m}(between n and m times)
Anchors
^(start of string)$(end of string)
Groups and Alternation
(...)for grouping|for alternation
JQL Escape Sequences
JQL has limited escape sequence support. Valid escape sequences are:
\\'(single quote),\\"(double quote)\\t(tab),\\n(newline),\\r(carriage return)\\\\(backslash),\\(space)\\uXXXX(Unicode character)
Performance Considerations
- Simple patterns are faster than complex ones
- Searching in large text fields (like description) may be slower
- Use specific subqueries to limit the result set
Error Handling
The function will return an error if:
- The regular expression pattern is invalid
- The specified field name is not valid or not found
- The JQL subquery is invalid