Jira Automation smart value
match() in Jira Automation: syntax and examples
match() runs a regular expression against a text value and returns what the first capture group caught. It is the tool for pulling a build number, a keyword argument or an identifier out of a summary, description or comment.
Syntax
{{issue.summary.match("regular expression with (a group)")}}
Arguments
| Argument | What it is | Required |
|---|---|---|
regular expression | Java regular expression. The part in round brackets is the group that is returned. | yes |
Works on
- Fields: any text value
- Returns: the text of the first group; a list when the expression matches several times; empty when nothing matches
Examples
{{issue.summary.match(".*(lo).*")}}Returns the characters caught by the group, which is lo in Hello World!.
Result:
loRun on Jira Cloud on .
{{issue.comments.last.body.match(".*build (\d+).*")}}Reads the build number out of the latest comment. With a comment reading Second comment: fixed in build 42 the result is the number alone.
Result:
42Run on Jira Cloud on .
{{issue.description.match("Customer (\w+)")}}Takes the word that follows a keyword in the description, without having to match the whole text.
Result:
reportedRun on Jira Cloud on .
{{issue.summary.match("(?i).*(world).*")}}The (?i) flag ignores case, and the group returns the text as it is written in the summary.
Result:
WorldRun on Jira Cloud on .
{{issue.summary.match("(o)")}}Without leading and trailing wildcards, the expression is searched for repeatedly. Both o characters come back as a list.
Result:
o, oRun on Jira Cloud on .
{{issue.summary.match(".*(xyz).*")}}When nothing matches the result is empty, so a later step can test for that.
Run on Jira Cloud on .
Where the documentation differs
{{issue.summary.match(".*(o).*")}}Run on Jira Cloud, : the documentation says
[o, o], the actual result iso.
Pitfalls
- A group is required.
match("Hello")has no round brackets and gave an empty result, even though the text contains Hello (checked on Jira Cloud, November 2026). - Whether you get one value or a list depends on the expression.
.*(o).*matches the whole text once and gave a single o, while(o)matched twice and gave a list. Atlassian's page shows[o, o]for the first form, which is not what Jira returned (checked on Jira Cloud, November 2026). - Only the first group is returned.
(\w+) (\w+)on Hello World! gave Hello, so use separate calls or a different expression when you need the second word. - Calling
.firston a single match gave an empty result (checked on Jira Cloud, November 2026). Use.firstonly when the result is a list.
Questions and answers
How do I search for text that contains regular expression characters?
Wrap it with quote(), which escapes the whole value as a literal. The output starts with \Q and ends with \E.
Related
- replace(), replaceAll() and remove()
- split()
- substringAfter(), substringBefore(), substringBetween()
- isEmpty() and isNotEmpty()
- htmlEncode, xmlEncode, jsonEncode and quote()