# left() and right() in Jira Automation: examples

URL: https://goingstellar.ro/reference/smart-values/left-right/

left(n) returns the first n characters of a text and right(n) returns the last n. They are the quick way to cut a fixed-size piece, like a short preview of a description or the number at the end of a reference.

## Syntax

```
{{issue.summary.left(5)}}
{{issue.summary.right(6)}}
```

## Arguments

- `length` (required: yes): How many characters to keep

## Works on

- Fields: text smart values
- Returns: text

## Examples

```
{{issue.summary.left(5)}}
```

Show the first word of a short title. With a summary of Hello World! the first five characters are the word Hello.

Result:

```
Hello
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.right(6)}}
```

Take the last six characters, for example a fixed-length suffix.

Result:

```
World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.description.left(13).concat("...")}}
```

Build a short preview of a description for a notification.

Result:

```
Checkout page...
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.right(6).toUpperCase()}}
```

Chain with another function to shout the ending of a title.

Result:

```
WORLD!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.left(50)}}
```

Ask for more characters than the text has: you get the whole text, no error and no padding.

Result:

```
Hello World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.left(9)}}
```

Cut in the middle of a word when the limit falls there, as in a 9 character preview.

Result:

```
Hello Wor
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- Both functions cut by count, so they can split a word. For a preview that ends on a word boundary use abbreviate() or cut at a separator with substringBefore().
- A length of 0 or a negative number gives an empty text rather than an error (checked on Jira Cloud, November 2026). Do not feed it a computed length that can go negative.
- Requesting more characters than exist returns the whole text unchanged, so a length check is not needed before calling left() or right().

## Related

- [substring()](https://goingstellar.ro/reference/smart-values/substring/)
- [abbreviate()](https://goingstellar.ro/reference/smart-values/abbreviate/)
- [charAt()](https://goingstellar.ro/reference/smart-values/charat/)
- [substringAfter(), substringBefore(), substringBetween()](https://goingstellar.ro/reference/smart-values/substringafter-substringbefore/)
- [length()](https://goingstellar.ro/reference/smart-values/length/)
- [concat()](https://goingstellar.ro/reference/smart-values/concat/)

## Sources

- [Jira smart values: text fields (Atlassian Support)](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/)

