Going Stellar

Home/Smart values reference

Jira Automation smart value

withDayOfMonth() and with… setters: Jira smart values

The with… functions replace one part of a date and keep the rest. Use them to snap a date to the 1st, move it to a fixed hour for a reminder, or rebuild a date in another month or year. They chain, so you can set several parts in one smart value.

Syntax

{{[date].with[attribute](input)}}
{{now.withDayOfMonth(15)}}

Arguments

ArgumentWhat it isRequired
inputThe new value for that part of the date, for example a day number, a month number or an houryes

Works on

  • Fields: now, created, updated and other date-time values
  • Returns: the same date with that one part replaced; attributes include second, minute, hour, dayOfMonth, monthOfYear, year, dayOfYear

Examples

{{now.withDayOfMonth(15)}}

The 15th of the current month, with the time of day kept.

Result:

2026-11-15T16:02:38.8+0000

Run on Jira Cloud on .

{{issue.created.withHour(9).withMinute(0).withSecond(0)}}

Moves the creation time to 09:00 on the same day, a typical reminder time. The milliseconds are not cleared.

Result:

2026-11-29T09:00:00.5+0000

Run on Jira Cloud on .

{{now.withMonth(12).withDayOfMonth(25).format("dd MMM yyyy")}}

Chains two setters and then formats the result as a date for a message.

Result:

25 Dec 2026

Run on Jira Cloud on .

{{now.withYear(2030).withDayOfYear(1).format("yyyy-MM-dd")}}

Builds the first day of 2030 from today's date.

Result:

2030-01-01

Run on Jira Cloud on .

{{now.withDayOfYear(355)}}

The 355th day of the current year, taken straight from the docs.

Result:

2026-12-21T16:02:39.0+0000

Run on Jira Cloud on .

{{issue.duedate.withDayOfMonth(1)}}

On a due date of 2026-12-15, the first day of the due month. A date-only field stays date-only.

Result:

2026-12-01

Run on Jira Cloud on .

Pitfalls

  • A value that does not exist is an error, not a rounding. {{now.withDayOfMonth(31)}} in a 30-day month, withDayOfMonth(0) and withMonth(13) all failed with "Failed to get value" (checked on Jira Cloud, November 2026). Use endOfMonth when you want the last day.
  • Time setters need a time. {{issue.duedate.withHour(17)}} rendered empty because a due date has no time of day (checked on Jira Cloud, November 2026).
  • With the day-of-year setter, the result depends on the year: the docs show day 355 as 20 December for a leap year, while 2026 gives 21 December.
  • withDayOfWeek(1) rendered empty. To land on a weekday, use withNextDayOfWeek instead.

Sources

  1. Jira smart values: date and time (Atlassian Support)
  2. Use smart values to manipulate and format dates (Atlassian Support)

Markdown version · All smart values