# parent in CQL: syntax and examples (Confluence)

URL: https://goingstellar.ro/reference/cql/parent-field/

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

- `contentId` (optional: yes): The numeric id of the parent page.

## 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 = page
```

The chapters directly under a handbook, one level only. Run on Confluence Cloud on 2026-11-29.

```
parent = 32964613 AND type = page ORDER BY title ASC
```

The same list in alphabetical order, ready to compare with a table of contents. Run on Confluence Cloud on 2026-11-29.

```
parent != 655541 AND space = SD AND type = page
```

Pages in a space that are not direct children of the space home, so the nested ones. Run on Confluence Cloud on 2026-11-29.

```
ancestor = 655541 AND parent != 655541 AND type = page
```

Combines both fields to isolate the deeper levels of a tree. Run on Confluence Cloud on 2026-11-29.

```
parent = 32964613 AND title ~ "policy"
```

Policies at the first level of the handbook. Run on Confluence Cloud on 2026-11-29.

## 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)` and `parent 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, while `ancestor = 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 ~ 655541` returns Expecting a value for operator '~' after field 'parent' but got '655541'.

## Related

- [ancestor](https://goingstellar.ro/reference/cql/ancestor-field/)
- [id](https://goingstellar.ro/reference/cql/id-field/)
- [=](https://goingstellar.ro/reference/cql/equals-operator/)
- [!=](https://goingstellar.ro/reference/cql/not-equals-operator/)
- [IN](https://goingstellar.ro/reference/cql/in-operator/)
- [space](https://goingstellar.ro/reference/cql/space-field/)

## Sources

- [CQL fields (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-fields/)

