# join() in Jira Automation: syntax and examples

URL: https://goingstellar.ro/reference/smart-values/list-join/

join() writes the items of a list on one line, with the separator you give between them. It is the short way to print labels, versions or comment bodies without a loop and without a trailing comma.

## Syntax

```
{{list.join(separator)}}
```

## Arguments

- `separator` (required: yes): The text placed between two items, in double quotes. An empty string glues the items together.

## Works on

- Fields: any list, such as issue.labels, issue.comments.body or the result of split().
- Returns: one text value.

## Examples

```
{{issue.labels.join(", ")}}
```

Put all labels in a notification line.

Result:

```
checkout, demo
```

Run on Jira Cloud on 29 Nov 2026.

```
Labels: {{issue.labels.join(", ")}}
```

Add a caption in front of the list, written as normal text around the smart value.

Result:

```
Labels: checkout, demo
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.comments.body.join(" / ")}}
```

Collect every comment body into one line with a visible divider.

Result:

```
First comment from QA / Second comment: fixed in build 42
```

Run on Jira Cloud on 29 Nov 2026.

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

Split the summary into words and join them with hyphens, as a start for a branch name or a slug.

Result:

```
Hello-World!
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.labels.join(", ").toUpperCase()}}
```

Chain a text function after join() to change the whole line at once.

Result:

```
CHECKOUT, DEMO
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.labels.join("")}}
```

Use an empty separator to glue the items together.

Result:

```
checkoutdemo
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- `join()` without a separator gives an empty string, not a default comma (checked on Jira Cloud, November 2026). Always pass the separator, even when it is a single space.
- A list with no items joins to an empty string. A field that is empty on the work item, such as `issue.fixVersions.name`, leaves the line blank, so add a caption only inside an `if` block when the caption alone would look wrong.
- On a list of comments, join() prints the comment bodies. Writing `.body` keeps the intent explicit.

## Related

- [{{#list}}…{{/}} iteration](https://goingstellar.ro/reference/smart-values/list-iteration/)
- [split()](https://goingstellar.ro/reference/smart-values/split/)
- [first, last, get(), getFromEnd()](https://goingstellar.ro/reference/smart-values/list-first-last-get/)
- [toLowerCase() and toUpperCase()](https://goingstellar.ro/reference/smart-values/tolowercase-touppercase/)
- [{{issue.comments}}](https://goingstellar.ro/reference/smart-values/issue-comments/)

## Sources

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

