Skip to main content
Skip table of contents

Query Wildcards

PocketQuery lets you use wildcards as parameter values instead of fixed ones. These wildcards will be replaced by a given value from the Query context before the Query is executed. The wildcards can be set by the user when adding the PocketQuery macro to a page, or directly within the query statement or REST URL itself. This way the macro user herself has no opportunity to adjust the values manually, which can be preferred for security reasons.

The following wildcards can be set as parameters values:

@space.key

the human readable space key of the current Confluence content (e.g. SPACE)

@space.id

the space ID of the current Confluence content (e.g. 12345678)

@space.name

the name of the current space

@content.type

the type of the current Confluence content (page or blogpost)

@content.version

the version of the current Confluence content (e.g. 42)

@content.id

the ID of the current Confluence content (e.g. 12345678)

@content.title

the title of the current Confluence content (e.g. Documentation)

@macro.id

the ID of the macro executing your Query (e.g. abc-123-def-456)

@user.displayName

the name of the current Confluence user (e.g. Emily Smith)

@user.email

the email address of the current Confluence user

Wildcards can be used in two different ways:

  1. They can be part of the Query statement directly. In this case, the wildcard needs to be prefixed by a : like a normal parameter:

CODE
SELECT *
FROM customers
WHERE companyName = :@space.key

The same is true for REST Queries:

CODE
/rest/search?query=:@content.id
  1. Wildcards can be used as values for Query parameters. To do this, simply enter your desired wildcard via the PocketQuery macro editor:

Macro editor with parameter field

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.