Going Stellar

Home/Smart values reference

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

ArgumentWhat it isRequired
lengthTotal number of characters wantedyes
padThe text used for padding, in straight double quotesyes

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:

00043

Run 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-43abab

Run 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, and rightPadPad(14,"-") without the tag does the same (checked on Jira Cloud, November 2026). Type rightPad.
  • 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.

Sources

  1. Jira smart values: text fields (Atlassian Support)

Markdown version · All smart values