Jira Automation smart value
leftPad() and rightPad() in Jira Automation
leftPad(n, pad) adds the pad text at the start until the whole text is n characters long, and rightPad(n, pad) adds it at the end. Use them for zero-filled numbers, aligned columns in a plain-text message, or fixed-width reference codes.
Syntax
{{issue.summary.leftPad(14, "-")}}
{{issue.summary.rightPad(14, "-")}}
Arguments
| Argument | What it is | Required |
|---|---|---|
length | Total number of characters wanted | yes |
pad | The text used for padding, in straight double quotes | yes |
Works on
- Fields: text smart values
- Returns: text
Examples
{{issue.key.substringAfter("-").leftPad(5, "0")}}Turn the number of an issue key into a five-digit code. For WEB-43 the result is 00043.
Result:
00043Run on Jira Cloud on .
{{issue.summary.leftPad(14, "-")}}Right-align a short title in a 14 character column. With a summary of Hello World! two characters of padding are added.
Result:
--Hello World!Run on Jira Cloud on .
{{issue.summary.rightPad(14, "-")}}Pad on the right to build a plain-text table whose columns line up.
Result:
Hello World!--Run on Jira Cloud on .
{{issue.summary.rightPad(20, ".")}}A dotted leader, as in a table of contents.
Result:
Hello World!........Run on Jira Cloud on .
{{issue.key.substringBefore("-").rightPad(6, "_")}}Fill the project part of a key to a fixed width.
Result:
WEB___Run on Jira Cloud on .
{{issue.key.rightPad(10, "ab")}}A pad of several characters repeats and is cut at the target length.
Result:
WEB-43ababRun on Jira Cloud on .
Where the documentation differs
{{issue.summary.<br/>rightPadPad(14,"-")}}Run on Jira Cloud, : the documentation says
Hello World!--, the actual result is.
Pitfalls
- The rightPad example in the Atlassian documentation contains an HTML line break and a misspelt function name (
rightPadPad). Copied as written it renders an empty text, andrightPadPad(14,"-")without the tag does the same (checked on Jira Cloud, November 2026). TyperightPad. - A text that is already as long as the target, or longer, is returned unchanged. Padding never shortens or cuts.
- Calling leftPad() without the pad argument renders an empty text instead of an error, so a missing second argument looks like a missing value.
Related
- length()
- substringAfter(), substringBefore(), substringBetween()
- concat()
- format() and formatWithLocale()
- left() and right()
- trim()