Going Stellar

Home/CQL reference

CQL field

fileExtension in CQL (Confluence): syntax, examples

The fileExtension field finds files by their extension, such as pdf or svg. Use it for attachment clean-ups, for example to list all images in a space or to find large PDFs. Write the extension in lower case and without the dot.

Syntax

fileExtension = "svg"
fileExtension in ("pdf", "png", "json")
fileExtension != "svg"

Arguments

ArgumentWhat it does
valueA file extension without the dot, in lower case. Quotes are optional for a simple value.

Works with

  • Operators: =, !=, IN, NOT IN (~ and !~ are rejected)
  • Functions: none
  • Related undocumented field: filesize, which accepts comparison operators

Examples

fileExtension = "svg" AND type = attachment AND space = SD ORDER BY title

Lists the SVG files attached in a space, sorted by name, before a switch to a new icon set.

Run on Confluence Cloud on .

fileExtension in ("jpg", "jpeg", "png", "gif") AND type = attachment

Finds the raster images across all spaces, for example to check which ones need alt text or compression.

Run on Confluence Cloud on .

fileExtension != "svg" AND type = attachment

Shows all attachments that are not SVG files.

Run on Confluence Cloud on .

fileExtension = "svg" AND created >= "2026-01-01"

Finds SVG files uploaded this year.

Run on Confluence Cloud on .

filesize > 1000 AND fileExtension = "svg"

Finds SVG files larger than 1000 in the size unit of the field, a starting point for finding heavy files.

Run on Confluence Cloud on .

Pitfalls

  • The value is case-sensitive. fileExtension = "svg" finds the files, fileExtension = "SVG" runs and finds nothing. Convert names to lower case first, or list both spellings with IN (checked on Confluence Cloud, November 2026).
  • Do not include the dot. fileExtension = ".svg" runs without an error and finds nothing.
  • fileExtension ~ "svg" fails with: Operator '~' is not supported for field 'fileExtension'. There is no partial matching, so list every extension you want.
  • filesize is not in the field reference, but it works: filesize > 1000 runs and the unknown-field error lists it among valid names. The docs give no unit, so test with a known file before you rely on a threshold.

Questions and answers

How do I find pdf files?

Use fileExtension = "pdf". Add type = attachment to make the intent clear.

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages