CQL function
endOfWeek() in CQL: syntax and examples for Confluence
endOfWeek() is the boundary that ends the current week. With a negative offset it names the end of a past week, so two calls give you any closed week for a weekly review: after the earlier end, up to the later one.
Syntax
endOfWeek()
endOfWeek("inc")
Arguments
| Argument | What it does | Optional |
|---|---|---|
inc | Optional offset in the form (+/-)nn(y|M|w|d|h|m): y year, M month, w week, d day, h hour, m minute. Quoted. With no sign, plus is assumed. The unit is required and case sensitive, and the offset moves the boundary. | no |
Works with
- Fields: created, lastmodified
- Operators: =, !=, >, >=, <, <=
- Not with: ~, !~, IN, NOT IN (checked on Confluence Cloud, November 2026:
created ~ endOfWeek()is rejected)
Examples
created > endOfWeek("-1w")Content created after last week ended, which is this week so far. This is the documentation example.
Run on Confluence Cloud on .
lastmodified > endOfWeek("-1w") AND lastmodified <= endOfWeek()Edits made this week, with a bound on both sides.
Run on Confluence Cloud on .
lastmodified > endOfWeek("-2w") AND lastmodified <= endOfWeek("-1w") AND type = pagePages edited during last week, for a Monday review. Slide both offsets by one to get the week before.
Run on Confluence Cloud on .
type = comment AND created > endOfWeek("-1w")Comments added this week, to see whether the review page got any feedback.
Run on Confluence Cloud on .
lastmodified <= endOfWeek() AND space = SD ORDER BY lastmodified DESCEverything in a space edited up to the end of this week, most recent first.
Run on Confluence Cloud on .
Pitfalls
- Weeks are counted the same way as in startOfWeek(). On the Confluence Cloud site checked in November 2026,
endOfWeek()on a Sunday resolved to 00:00 on the next Monday, which is the same instant as the nextstartOfWeek(). - Use a strict
>on the lower bound and<=on the upper bound. Mixing it up with>=counts content at the exact boundary in two adjacent weeks. - A positive offset is accepted, for example
endOfWeek("+1w"), and gives the end of next week. It has little use oncreatedandlastmodified, which cannot lie in the future. - The value is built from text, so a typo only shows up at run time:
endOfWeek("-1s")fails with HTTP 500 "IllegalArgumentException executing cql".