# withNextDayOfWeek() in Jira Automation: syntax and examples

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

withNextDayOfWeek moves a date forward to the next matching weekday. If the date is already on that weekday, the result is a week later. Use it to schedule reminders for the next Monday morning or to push a due date to the next Friday.

## Syntax

```
{{[date].withNextDayOfWeek("day")}}
```

## Arguments

- `day` (required: yes): One of MON, TUE, WED, THU, FRI, SAT, SUN, in quotes

## Works on

- Fields: now, created and other date-time values
- Returns: the date of the next matching weekday, with the time of day kept

## Examples

```
{{now.withNextDayOfWeek("SUN")}}
```

On a Sunday, asking for the next Sunday gives the one a week later, not the same day.

Result:

```
2026-12-06T16:18:05.9+0000
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.withNextDayOfWeek("MON").toStartOfDay}}
```

Next Monday at midnight, a clean start for a weekly window.

Result:

```
2026-11-30T00:00:00.0+0000
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.withNextDayOfWeek("MON").withHour(9).withMinute(30).format("yyyy-MM-dd HH:mm")}}
```

Next Monday at 09:30 in a fixed format, for a reminder text.

Result:

```
2026-11-30 09:30
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.duedate.withNextDayOfWeek("FRI")}}
```

With a due date of Tuesday 2026-12-15, the Friday after it.

Result:

```
2026-12-18
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.duedate.withNextDayOfWeek("FRI").format("EEEE, d MMMM")}}
```

The same Friday written out for a human reader.

Result:

```
Friday, 18 December
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.withNextDayOfWeek("mon")}}
```

Lowercase day codes are accepted.

Result:

```
2026-11-30T16:18:06.1+0000
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- Only the three-letter codes work. `"MONDAY"` and an unquoted `MON` both failed with "Failed to get value" (checked on Jira Cloud, November 2026).
- Setting the hour and minute does not clear the seconds. The docs example for Monday at 2pm gave 14:00 with the seconds and milliseconds of the run still attached (checked on Jira Cloud, November 2026). Add `.withSecond(0)` if it matters, or format the result.
- The docs examples put prose after the closing braces. That text is not removed: the rendered value contains the date followed by the sentence.
- Running it on the target weekday skips to the following week. Test the rule on a Monday if it is meant to run on Mondays.

## Related

- [withDayOfMonth(), withMonth() and other with… setters](https://goingstellar.ro/reference/smart-values/date-with/)
- [startOfMonth and endOfMonth](https://goingstellar.ro/reference/smart-values/startofmonth-endofmonth/)
- [firstOfTheMonth(), lastOfTheMonth(), ofTheMonth()](https://goingstellar.ro/reference/smart-values/firstofthemonth-lastofthemonth/)
- [toBusinessDay(), plusBusinessDays() and business-day helpers](https://goingstellar.ro/reference/smart-values/business-days/)
- [plusDays() / minusDays() and other units](https://goingstellar.ro/reference/smart-values/date-plus-minus/)

## Sources

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

