# split() in Jira Automation: syntax and examples

URL: https://goingstellar.ro/reference/smart-values/split/

split() cuts a text value at every separator and returns a list of the pieces. Combine it with first, last, get() or size to pick a word, or iterate over the pieces in a later step.

## Syntax

```
{{issue.summary.split(" ")}}
```

## Arguments

- `separator` (required: yes): The text to cut at. It is read as a regular expression.

## Works on

- Fields: any text value
- Returns: a list of text pieces; use first, last, get(n) or size on it

## Examples

```
{{issue.summary.split(" ").first}}
```

Takes the first word of a summary, for example to address a name in a message.

Result:

```
Hello
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.split(" ").last}}
```

Takes the last word.

Result:

```
World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.split(" ").get(1)}}
```

Picks a piece by position. The first piece is number 0, so 1 is the second word.

Result:

```
World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.split(" ").size}}
```

Counts the pieces.

Result:

```
2
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.split(" ").join("-")}}
```

Chains join() to rebuild the text with another separator.

Result:

```
Hello-World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{#issue.summary.split(" ")}}<{{.}}>{{/}}
```

Iterates over the pieces and wraps each one.

Result:

```
<Hello><World!>
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- The separator is a regular expression. In a description with several sentences, `split(". ")` treats the dot as any character, so `.first` gave Checkou, cut at the t before the space (checked on Jira Cloud, November 2026). `split(".")` gave an empty list with size 0.
- A pipe is also special. `split("|")` on the summary plus `|x` gave a list of 14 pieces, one per character, so escape it or pick another separator.
- Repeated separators create empty pieces. `split("l")` on Hello World! gave He, an empty piece, o Wor and d!. With three spaces between the words, the list has 4 pieces, not 2.
- When the separator does not occur, the list has one piece, the original text. `split("Z").first` gave Hello World! unchanged.

## Related

- [first, last, get(), getFromEnd()](https://goingstellar.ro/reference/smart-values/list-first-last-get/)
- [join()](https://goingstellar.ro/reference/smart-values/list-join/)
- [{{#list}}…{{/}} iteration](https://goingstellar.ro/reference/smart-values/list-iteration/)
- [match()](https://goingstellar.ro/reference/smart-values/match/)
- [replace(), replaceAll() and remove()](https://goingstellar.ro/reference/smart-values/replace/)
- [size and isEmpty on lists](https://goingstellar.ro/reference/smart-values/list-size-isempty/)

## Sources

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

