# distinct in Jira Automation: syntax and examples

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

distinct returns the items of a list once each, without duplicates. The Atlassian page uses it after a Lookup issues action to print each parent only once. It also works on any other list, such as the authors of comments.

## Syntax

```
{{list.distinct}}
```

## Works on

- Fields: any list, including lists of values taken from a property, such as issue.comments.author.
- Returns: a list without repeated items, which you can chain with size or join().

## Examples

```
{{issue.summary.replace("Hello World!","a,b,a,c,b").split(",")}}
```

Build a list with repeated values to see the starting point: five items, with a and b twice.

Result:

```
a, b, a, c, b
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.replace("Hello World!","a,b,a,c,b").split(",").distinct}}
```

Remove the repeats from the same list.

Result:

```
a, b, c
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.replace("Hello World!","a,b,a,c,b").split(",").distinct.size}}
```

Count how many different values the list holds.

Result:

```
3
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.comments.author.size}}
```

Count the comments by author, with repeats.

Result:

```
2
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.comments.author.distinct.size}}
```

Count how many different people commented. Two comments from the same user count once.

Result:

```
1
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.replace("Hello World!","b,a,b").split(",").distinct.join("+")}}
```

Chain distinct with join() to print the unique values on one line.

Result:

```
b+a
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- distinct keeps the order of the first appearance. The values b, a, b become b and a, not a and b.
- The unique count is `distinct.size`: distinct comes first, and the function that reads the list follows it.
- On a work item without duplicates distinct changes nothing: the two labels checkout and demo print the same with and without it.

## Related

- [size and isEmpty on lists](https://goingstellar.ro/reference/smart-values/list-size-isempty/)
- [join()](https://goingstellar.ro/reference/smart-values/list-join/)
- [flatten()](https://goingstellar.ro/reference/smart-values/list-flatten/)
- [split()](https://goingstellar.ro/reference/smart-values/split/)
- [{{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/)

