Configure the “Search Macro” from “Refined for Confluence” to use page metadata fields as search parameter

In this article, we are going to describe how to configure the “Search Macro” from “Refined for Confluence” app into using page metadata fields as search parameters.

This macro can be configured using several parameters, one of them being the “CQL” parameter, where you can define a search query according to “Advanced Searching using CQL”.

For more information regarding the “Search Macro” click here.

Instructions

To adjust the “Seach Macro” into searching pages according to their metadata field values, configure the following as CQL parameter:

(space ="SPACE_KEY") or (METADATA_FIELD_KEY="$query")

Search Macro parameters - CQL parameter

 

You should:

  • Change “METADATA_FIELD_KEY” to the key of the metadata field you want to include in your search.

  • Change the space key “SPACE_KEY” to your space key.

 

With this configuration, if you enter the value “jira” in the search input, you will get the following results:

  1. All Confluence pages (from every space) that have the value “jira” in the metadata field with key “METADATA_FIELD_KEY”

  2. Pages from the space with key “SPACE_KEY” that have the word “jira” in their title

  3. Pages from the space with key “SPACE_KEY” that have a label “jira”