CQL Search



This page provides documentation for the CQL (Confluence Query Language) Search macro.

For more information about CQL syntax, check out Atlassian's documentation here: https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/

This addon consists of two parts: an interface for you to search for pages using CQL and a macro to embed a CQL search in a page.

CQL is still fairly new and was developed by Atlassian to enable JQL (JIRA Query Language)-style searching of Confluence pages.

Although it is available for developers as a REST call, this addon makes it available to all users in the interface.


Releases Changelog
1.0.0

Intial Release

1.0.1

Fixed bug where labels column was always shown in page macro

Added new CQL functions in page macro: pageId() and spaceKey()

You can use these to refer to the current page/space, so you could
(for example) use it to filter all child pages by a certain criteria (i.e.
"ancestor=pageId() and type=page and...") 

1.0.2

Fix GDPR compatibility

Remove moment.js dependency

1.0.3

Update API calls for new pagination system

Bug fixes for robustness of displayed data


CQL Search Page

To perform a search, just go to any page and click the Extra Tools menu (•••) and click on "CQL Search"



You will be presented with the following screen:



From here it is pretty self-explanatory: you can choose the number of results you want to show at a time and which columns will be displayed in your search. Your options will be saved (in the browser) and will be available the next time you come back to the search page.

If you remove one of the columns and want to re-add it again, simply click somewhere in the white space and you will see the options menu below the select box.  

Your search results will be displayed below, or an error will be shown describing the problem with the query.  Clicking on the title will open the item in a new page.

Unfortunately, the CQL REST API as implemented by Atlassian does not yet support showing the full number of results, so you will have to step through the results a page at a time.  

If more results are available than the limit you have chosen, you will see Next and/or Prev buttons available at the bottom of your results to see the next or previous page.


CQL Search Macro

If you have a particular search that you want to call again and again, or if you want to display search results to other users, then you can use the CQL Search macro to embed the search results in a page.



Just choose the CQL Query macro from the macro browser and you will be presented with the macro options.

Just as in the search page, you can choose the number of results per page and the visible columns.



That's all there is to it!


Tips and Tricks

Searching for attachments with a particular file extension


Searching for file extension

To search for an attachment with a particular file extension, the syntax is as follows (docx as an example):

type = attachment AND title ~ "/.*docx/"



Support

If you encounter any problems with the addon, please file a support issue at https://streamlinesoft.zendesk.com/