Jira Automation smart value
trim() in Jira Automation: syntax and examples
trim() removes whitespace from the start and end of a text value. Use it on pasted titles, on values built by concat(), and before comparing or counting text.
Syntax
{{issue.summary.trim()}}
Works on
- Fields: any text value
- Returns: the text without leading or trailing whitespace
Examples
{{issue.summary.trim()}}On a clean summary nothing changes, so it is safe to add as a habit.
Result:
Hello World!Run on Jira Cloud on .
{{issue.summary.concat(" ").concat("|")}}The marker at the end shows that the three added spaces are there.
Result:
Hello World! |Run on Jira Cloud on .
{{issue.summary.concat(" ").trim().concat("|")}}With trim() the marker sits directly after the last character.
Result:
Hello World!|Run on Jira Cloud on .
{{issue.summary.concat(" ").trim().length()}}Back to 12 characters, which is what a length check should see.
Result:
12Run on Jira Cloud on .
{{issue.summary.replace("Hello"," Hello").trim()}}Removes spaces at the start as well as the end.
Result:
Hello World!Run on Jira Cloud on .
{{issue.summary.replace(" "," ").trim()}}Spaces between words are left alone.
Result:
Hello World!Run on Jira Cloud on .
Pitfalls
- trim() only touches the two ends. The spaces between words remain, so a split on a single space of the result gave 4 pieces for a title with three spaces between the words (checked on Jira Cloud, November 2026). Use
replaceAll("\s+"," ")to collapse the middle. - In a log line or a comment the extra spaces are invisible. Add a visible marker such as
|after the value while you test, as in the examples.