Going Stellar

Home/CQL reference

CQL operator

IN operator in CQL (Confluence): syntax, examples

IN matches content when a field holds any one of several values. You write the values in parentheses, separated by commas. It replaces a chain of = clauses joined with OR, so a query for three page titles or two file types stays short.

Syntax

field IN (value1, value2, ...)
field in (value1, value2)

Arguments

ArgumentWhat it doesOptional
fieldA CQL field that supports IN, such as type, space, title, ancestor, id, label or fileExtension.yes
valuesOne or more values in parentheses, separated by commas. Text values with spaces need double quotes.yes

Works with

  • Operators: IN works on ancestor, content, contributor, creator, favourite, fileExtension, id, label, macro, mention, owner, pageStatus, space, subtype, title, type and watcher.
  • Functions: currentUser() inside the list, for fields that take users.
  • Not with: created, lastmodified and text (these take comparison or ~ operators), and parent (it fails, see the pitfalls).

Examples

type in (page, attachment) and space = SD

Lists pages and uploaded files from one space in a single query, for example before a space cleanup.

Run on Confluence Cloud on .

title in ("Code of Conduct", "Remote Work Guidelines", "Information Security Policy")

Pulls the exact set of policy pages a new hire has to read.

Run on Confluence Cloud on .

fileExtension in ("svg", "jpg")

Finds image attachments of two formats without writing two clauses.

Run on Confluence Cloud on .

ancestor in (32964613, 655541) and type = page

Collects every page under either of two parent pages, such as a handbook and a space home.

Run on Confluence Cloud on .

type in (page, comment) and space = SD ORDER BY lastmodified DESC

Shows the latest activity in a space, pages and comments together, newest first.

Run on Confluence Cloud on .

Pitfalls

  • The documentation says IN works on parent. parent in (32964613) fails with HTTP 500 and the message "IllegalArgumentException executing cql". Use parent = 32964613, or ancestor in (...) if any depth is fine (checked on Confluence Cloud, November 2026).
  • The documentation says IN does not work on title. It does: a list of exact page titles runs and returns every page that matches (checked on Confluence Cloud, November 2026). Titles must match in full, so a partial name finds nothing.
  • Unsupported fields name the allowed operators. created in (2026-11-01) fails with "Operator 'in' is not supported for field 'created'. Supported operators are : <, <=, >, >=, =, !=", and text in (...) says the field only accepts ~ and !~.
  • An unknown value stops the whole query. type in (page, foo) fails with "Unsupported value for type, got : foo", and an empty list () gives "Could not parse cql".

Questions and answers

Is IN the same as several = clauses joined with OR?

Yes, that is how the documentation describes it. The list form is shorter and easier to edit.

Sources

  1. CQL operators (Atlassian Developer, Confluence Cloud)
  2. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages