Jira Automation smart value
replace(), replaceAll(), remove(): syntax and examples
replace() swaps every occurrence of a literal piece of text, replaceAll() does the same with a regular expression and can reuse matched groups, and remove() deletes a piece of text. They clean pasted titles, build slugs and reshape values before another action uses them.
Syntax
{{issue.summary.replace("target", "replacement")}}
{{issue.summary.replaceAll("regex", "replacement")}}
{{issue.summary.remove("text")}}
Arguments
| Argument | What it is | Required |
|---|---|---|
target / regex / text | What to find. replace() and remove() treat it as plain text, replaceAll() as a regular expression. | yes |
replacement | The text to put in its place. In replaceAll() a group is written as a dollar sign and its number. | yes (not for remove) |
Works on
- Fields: any text value
- Returns: the changed text; unchanged when nothing matches
Examples
{{issue.summary.replace("Hello","Goodbye")}}Swaps one word for another in a summary.
Result:
Goodbye World!Run on Jira Cloud on .
{{issue.summary.replaceAll("(lo)","xx$1yy")}}Wraps the matched group with extra text by reusing it in the replacement.
Result:
Helxxloyy World!Run on Jira Cloud on .
{{issue.summary.replaceAll("(\w+) (\w+)","$2 $1")}}Swaps the two words by naming the groups in a different order.
Result:
World Hello!Run on Jira Cloud on .
{{issue.summary.toLowerCase().replaceAll("[^a-z0-9]+","-")}}Turns a summary into a slug for a URL or a branch name. Chains toLowerCase() and a character class.
Result:
hello-world-Run on Jira Cloud on .
{{issue.summary.remove(" ")}}Deletes every space, for values that must be one word.
Result:
HelloWorld!Run on Jira Cloud on .
{{issue.summary.replace("Hello","Goodbye").replace("!","?")}}Two replacements in a row, each working on the result of the one before.
Result:
Goodbye World?Run on Jira Cloud on .
Pitfalls
replace()is literal andreplaceAll()is a regular expression.replaceAll(".","-")turned all 12 characters of Hello World! into dashes, whilereplace(".","-")changed nothing because the summary has no dot (checked on Jira Cloud, November 2026).- Brackets are special in
replaceAll(). With a summary of Hello World! (v2),replaceAll("(v2)","X")gave Hello World! (X), because the brackets were read as a group, whilereplace("(v2)","X")gave Hello World! X. - All three are case sensitive.
replace("hello","Hi")andremove("L")left Hello World! unchanged. Add(?i)at the start of areplaceAll()expression to ignore case. - A lone dollar sign in the replacement is read as the start of a group reference, so replacing a letter with just that sign failed with a
Failed to get value for
error (checked on Jira Cloud, November 2026). The slug example also leaves a dash at the end when the title ends in punctuation.
Questions and answers
How do I use a matched group in the replacement?
Put the part to keep in round brackets in the expression and refer to it by number in the replacement, as the first example on this page does.
Related
- match()
- split()
- trim()
- toLowerCase() and toUpperCase()
- substringAfter(), substringBefore(), substringBetween()
- htmlEncode, xmlEncode, jsonEncode and quote()