# startsWith() and endsWith() in Jira Automation

URL: https://goingstellar.ro/reference/smart-values/startswith-endswith/

startsWith() and endsWith() answer true or false: does the text begin or end with the given text. They are the quick way to route work on a title prefix or a closing marker, often inside an if() condition.

## Syntax

```
{{text.startsWith("prefix")}}
{{text.endsWith("suffix")}}
```

## Arguments

- `prefix or suffix` (required: yes): The text to look for at the start or at the end. Case-sensitive.

## Works on

- Fields: any text value, such as issue.summary or issue.description.
- Returns: true or false.

## Examples

```
{{issue.summary.startsWith("Hello")}}
```

Check that a title begins with an agreed prefix.

Result:

```
true
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.startsWith("hello")}}
```

The same check with a different capital: the match fails.

Result:

```
false
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.summary.toLowerCase().startsWith("hello")}}
```

Lower the text first to ignore capitals.

Result:

```
true
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.description.endsWith("wrong.")}}
```

Check how a description ends, full stop included.

Result:

```
true
```

Run on Jira Cloud on 29 Nov 2026.

```
{{if(issue.summary.startsWith("Hello"), "Greeting", "Other")}}
```

Turn the answer into a word you can print in a message.

Result:

```
Greeting
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- Both functions compare exactly. `startsWith("hello")` is false on `Hello World!` (checked on Jira Cloud, November 2026), and punctuation counts: `endsWith("World@")` is false.
- The result is the text true or false, not a decision. Wrap it in `if()` to print something else, or use it inside a condition.
- The test looks at the whole value, so a longer prefix such as `startsWith("World!")` on `Hello World!` is false even though the text contains it.

## Related

- [equals() and equalsIgnoreCase()](https://goingstellar.ro/reference/smart-values/equals-text/)
- [toLowerCase() and toUpperCase()](https://goingstellar.ro/reference/smart-values/tolowercase-touppercase/)
- [{{#if}} … {{/}}](https://goingstellar.ro/reference/smart-values/if/)
- [match()](https://goingstellar.ro/reference/smart-values/match/)
- [indexOf() and lastIndexOf()](https://goingstellar.ro/reference/smart-values/indexof/)
- [trim()](https://goingstellar.ro/reference/smart-values/trim/)

## Sources

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

