Jira Automation smart value
firstOfTheMonth() and lastOfTheMonth(): Jira smart values
These functions pick a weekday inside the month of a date. firstOfTheMonth gives the first such weekday, lastOfTheMonth the last one and ofTheMonth the nth one. Use them for rules such as a review on the first Monday or a report on the last Friday.
Syntax
{{[date].firstOfTheMonth(input)}}
{{[date].lastOfTheMonth(input)}}
{{[date].ofTheMonth(n, day)}}
Arguments
| Argument | What it is | Required |
|---|---|---|
input / day | Weekday number: 1 Monday, 2 Tuesday, 3 Wednesday, 4 Thursday, 5 Friday, 6 Saturday, 7 Sunday | yes |
n | Which occurrence in the month, for example 2 for the second | yes (ofTheMonth) |
Works on
- Fields: now, created, duedate and other date values
- Returns: the matching day in the month of the given date, with the time of day kept
Examples
{{now.firstOfTheMonth(1)}}The first Monday of November 2026.
Result:
2026-11-02T16:02:39.3+0000Run on Jira Cloud on .
{{now.plusMonths(1).firstOfTheMonth(1)}}The first Monday of next month: shift the month first, then pick the weekday.
Result:
2026-12-07T16:18:31.4+0000Run on Jira Cloud on .
{{now.lastOfTheMonth(5)}}The last Friday of the current month.
Result:
2026-11-27T16:02:39.3+0000Run on Jira Cloud on .
{{now.ofTheMonth(2, 1)}}The second Monday of the month.
Result:
2026-11-09T16:02:39.4+0000Run on Jira Cloud on .
{{issue.duedate.lastOfTheMonth(5).format("dd MMM yyyy")}}The last Friday of the month of a due date, in a readable format.
Result:
25 Dec 2026Run on Jira Cloud on .
{{now.firstOfTheMonth(1).toStartOfDay.format("yyyy-MM-dd")}}The first Monday as a plain date for a comment or a field.
Result:
2026-11-02Run on Jira Cloud on .
Pitfalls
- The weekday argument is a number from 1 to 7.
firstOfTheMonth(8)andfirstOfTheMonth(0)failed with "Failed to get value", andfirstOfTheMonth("MON")rendered empty (checked on Jira Cloud, November 2026). ofTheMonthneeds both arguments.{{now.ofTheMonth(2)}}rendered empty (checked on Jira Cloud, November 2026).- Asking for an occurrence that does not exist did not fail.
{{now.ofTheMonth(5, 2)}}in November 2026, which has only four Tuesdays, gave the last Tuesday, the 24th (checked on Jira Cloud, November 2026). - The docs write the third function as
OfTheMonthin the heading andofTheMonthin the example. Use the lowercase form from the example.
Related
- withNextDayOfWeek()
- startOfMonth and endOfMonth
- withDayOfMonth(), withMonth() and other with… setters
- toBusinessDay(), plusBusinessDays() and business-day helpers
- plusDays() / minusDays() and other units