CQL field
parent in CQL: syntax and examples (Confluence)
parent returns the pages one level directly below a given page, nothing deeper. Use it when you want the first level of a section, such as the chapters of a handbook. For the whole subtree use ancestor.
Syntax
p
a
r
e
n
t
=
<
c
o
n
t
e
n
t
I
d
>
Arguments
| Argument | What it does | Optional |
|---|---|---|
contentId | The numeric id of the parent page. | yes |
Works with
- Operators: =, != (checked). The documentation also lists IN and NOT IN, but they fail, see below.
- Functions: none
- Not with: ~, !~, >, >=, <, <=, IN, NOT IN
Examples
parent = 32964613 AND type = pageThe chapters directly under a handbook, one level only.
Run on Confluence Cloud on .
parent = 32964613 AND type = page ORDER BY title ASCThe same list in alphabetical order, ready to compare with a table of contents.
Run on Confluence Cloud on .
parent != 655541 AND space = SD AND type = pagePages in a space that are not direct children of the space home, so the nested ones.
Run on Confluence Cloud on .
ancestor = 655541 AND parent != 655541 AND type = pageCombines both fields to isolate the deeper levels of a tree.
Run on Confluence Cloud on .
parent = 32964613 AND title ~ "policy"Policies at the first level of the handbook.
Run on Confluence Cloud on .
Pitfalls
- The documentation says IN and NOT IN are supported. They are not:
parent in (32964613)returns HTTP 500, ServiceException: IllegalArgumentException executing cql.parent not in (32964613)andparent in recentlyViewedContent(10)fail the same way (checked on Confluence Cloud, November 2026). Use = or !=, or switch to ancestor, which takes IN. - parent sees one level.
parent = 655541 AND title = "Code of Conduct"finds nothing, whileancestor = 655541 AND title = "Code of Conduct"finds the page, because it sits one level further down. - Like ancestor, it needs an id. A title or a text operator fails:
parent ~ 655541returns Expecting a value for operator '~' after field 'parent' but got '655541'.