Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Import Macro Repair

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:

Code Block
(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”

Subspace navigation macromaxDepthshowRoottruestartElement

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@957
showSpacefalse
sortmodified
typepage
reversetrue
labelsmetadata search search-macro
cqllabel in ( "search" , "metadata" , "search-macro" ) and type = "page" and space = "KB"
Page Properties
hiddentrue

Related issues

SCP-11177