Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,690
Community Members
 
Community Events
165
Community Groups

Useful CQL statements to search what you need in Confluence

CQL or Confluence Query Language is a powerful search language. It is a secret trick that only advanced Confluence users will know. 

Unlike its famous sibling JQL which is used in Jira advanced searching, CQL is not as well known and not well documented.

 

Here are some useful CQLs that you can use to search what exactly you need.

 

How to find a page by title within a specified space

space = SPACEKEY AND title ~ "meeting minutes"

This one helps to filter out a lot of noise especially when a lot of other pages also contains the same keyword

 

How to find an attachment by name

space = SPACEKEY AND type = Attachment AND title ~ "screenshot"

 

How to find a pdf attachment which the content contains a keyword (Confluence)

type = attachment AND title ~ "pdf" AND text ~ "confluence"

 

How to find a page containing a Confluence macro (e.g. CQL Navigation Macro)

type = Page AND macro = cqlnavigation

 

How to find a blog post that was created within the last month

space = SPACEKEY AND type = blogpost AND created > startOfMonth("-1M") AND created < startOfMonth()

 

How to find the comments you wrote over the past 1 week sorted by date posted

type = comment AND creator = currentUser() AND created > startOfDay("-1w") order by created desc

 

You can execute the CQL search by pasting it in the browser address bar in the format 

https://<confluence-base-url>/dosearchsite.action?cql=<CQL in the example below>.

Alternatively, it is possible to encode the CQL inside macros by Confluence apps such as Canned Search for Confluence so that users can use them directly without having to memorise the CQL syntax.

You can also find the guide to advance searching with CQL here

 

If you have any useful CQL statements to share, you are welcome to add on the list.

 

1 comment

Thanks for sharing. Your article makes CQL more approachable.

Like Hua Soon SIM _Akeles_ likes this

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

938 views 14 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you