# and, or, not in Jira Automation conditions: examples

URL: https://goingstellar.ro/reference/smart-values/and-or-not/

and() is true when both conditions are true, or() when at least one is, and not() flips a condition. Use them inside {{#if()}} to build rules such as a note for work items with a due date and labels.

## Syntax

```
{{and(condition1, condition2)}}
{{or(condition1, condition2)}}
{{not(condition)}}
```

## Arguments

- `condition1, condition2` (required: yes): Smart values that return true or false, such as comparisons, exists() or equals()

## Works on

- Conditions: comparisons, exists(), equals(), isEmpty and similar
- Returns: true or false

## Examples

```
{{#if(and(issue.comments.size.gt(1),issue.comments.size.lt(5)))}}Moderately active{{/}}
```

Match a range: more than one and fewer than five comments.

Result:

```
Moderately active
```

Run on Jira Cloud on 29 Nov 2026.

```
{{and(issue.labels.size.gt(0), issue.comments.size.gt(5))}}
```

Both checks must pass: labels yes, more than five comments no.

Result:

```
false
```

Run on Jira Cloud on 29 Nov 2026.

```
{{or(issue.labels.size.gt(5), issue.comments.size.gt(1))}}
```

One passing check is enough.

Result:

```
true
```

Run on Jira Cloud on 29 Nov 2026.

```
{{not(issue.labels.isEmpty)}}
```

Turn an emptiness check around.

Result:

```
true
```

Run on Jira Cloud on 29 Nov 2026.

```
{{#if(or(issue.comments.size.gt(20),issue.labels.size.gt(1)))}}Needs a look{{/}}
```

Flag a work item that is either heavily discussed or carries several labels.

Result:

```
Needs a look
```

Run on Jira Cloud on 29 Nov 2026.

```
{{#if(and(exists(issue.duedate),not(issue.labels.isEmpty)))}}Due {{issue.duedate.format("dd MMM")}} and labelled{{/}}
```

Chain three functions and a date format into one message.

Result:

```
Due 15 Dec and labelled
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- The or() doc example compares `issue.comments`, which is a list, with `gt(20)`. Compare the count instead: `issue.comments.size.gt(20)`.
- Comparisons on a field that does not exist, such as Votes on a site without that field, print nothing rather than failing, so a condition built on them is silently never true.

## Related

- [{{#if}} … {{/}}](https://goingstellar.ro/reference/smart-values/if/)
- [equals() and exists() in conditions](https://goingstellar.ro/reference/smart-values/conditional-equals-exists/)
- [gt(), gte(), eq(), lt(), lte()](https://goingstellar.ro/reference/smart-values/number-comparisons/)
- [size and isEmpty on lists](https://goingstellar.ro/reference/smart-values/list-size-isempty/)
- [isEmpty() and isNotEmpty()](https://goingstellar.ro/reference/smart-values/isempty-isnotempty/)

## Sources

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

