Going Stellar

Home/Smart values reference

Jira Automation smart value

withNextDayOfWeek() in Jira Automation: syntax and examples

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

ArgumentWhat it isRequired
dayOne of MON, TUE, WED, THU, FRI, SAT, SUN, in quotesyes

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 .

{{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 .

{{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 .

{{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 .

{{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 .

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

Lowercase day codes are accepted.

Result:

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

Run on Jira Cloud on .

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.

Sources

  1. Jira smart values: date and time (Atlassian Support)

Markdown version · All smart values