Going Stellar

Home/CQL reference

CQL field

pageStatus field in CQL: syntax and examples (Confluence)

pageStatus matches content that carries a given page status. It helps when your team uses statuses to track drafts and reviews and you want one list of everything that is not finished yet.

Syntax

pageStatus = "status name"
pageStatus IN ("status name", "status name")

Arguments

ArgumentWhat it doesOptional
status nameThe text of the status. Quote it when it has spaces, for example "Rough draft".yes

Works with

  • Operators: =, !=, IN, NOT IN (as documented).
  • Not with: ~, !~, >, >=, <, <=. The documentation lists no supported functions.

Examples

pageStatus = "Rough draft"

The documentation's example: every page marked as a rough draft.

Run on Confluence Cloud on .

pageStatus not in ("\"In progress\"", "\"Ready for review\"")

The documentation's example for content that is in neither of two statuses, written with escaped quotes exactly as printed there.

Run on Confluence Cloud on .

pageStatus not in ("In progress", "Ready for review")

The same filter with plain quoted values, which is the form most people would type.

Run on Confluence Cloud on .

pageStatus in ("Rough draft", "In progress") AND space = SD AND type = page

Unfinished pages in one space, a good base for a weekly clean-up list.

Run on Confluence Cloud on .

pageStatus = "Rough draft" AND lastmodified < now("-4w")

Drafts that have been sitting for a month without an edit.

Run on Confluence Cloud on .

pageStatus = "Ready for review" ORDER BY lastmodified DESC

The review queue, newest changes first.

Run on Confluence Cloud on .

Pitfalls

  • A status that does not exist is not an error. pageStatus = Draft and pageStatus = "In progress" run and return nothing when no page has that status, so spell the status exactly as it appears in the page header.
  • The documentation's escaped form "\"In progress\"" and the plain form "In progress" are both accepted by the search. Start with the plain form and only add the escaping if the plain one finds nothing on your site.
  • pageStatus ~ "draft" is rejected with "Operator '~' is not supported for field 'pageStatus'". There is no partial match, so list each status you want.
  • != and NOT IN also match pages that have no status at all, which is why a "not finished" filter returns far more than the drafts you see in the page tree. Add type = page and a space to narrow it.

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages