Pre-defined variables - 6.x

Pre-defined variables - 6.x

The following are available for variable substitution in the run and run-now macros:

Variable

Replacement

$current_user_id

Current logged in user's id or blank if not logged in.

$current_user_name

Current user's full name or blank if not logged in.

$current_user_email

Current user's email address or blank if not logged in.

$current_user_timezone_id

Current user's time zone setting id (example: America/Chicago). The default time zone will be used if the user is not logged in.

$current_user_timezone_offset

Current user's time zone setting offset (in hours) from GMT (examples: -6, 5.5) The default time zone will be used if the user is not logged in.

$current_time

Current date and time in the default Confluence format or format specified by the dateFormat parameter.

$current_time(<date format>)

Current date and time in the format provided in parentheses. The date format provided must be valid. See Examples - Date Field Selection. Since 4.8.

$page_title

Title of the current page.

$page_id

Numeric id of the current page.

$page_url

Full URL of the current page.

$page_tinyurl

Tiny URL of the current page.

$parent_page_title

Title of the parent page.

$parent_page_id

Numeric id of the parent page.

$parent_page_url

Full URL of the parent page.

$parent_page_tinyurl

Tiny URL of the parent page.

$space_name

Space name of the current space.

$space_key

Space key of the current space.

$confluence_home

Path to the Confluence Home directory.

$base_url

Base URL for Confluence.

$request_string

Encoded request parameters after a button press.

$include_page(<page reference>)

Includes un-rendered page source at the point of the variable and then proceeds to apply variable replacements as normal (not available for the wiki version of the macro). This means that the variables on the page being included will be replaced under the context of the original page. This means things like $page_title will represent the original page. Further more, this enables scenarios where one wants a template like page that can be brought in with substitution variables based on fixed parameters (run-now) or user input (run). This can prevent duplication in a number of user cases. The included content is inline with the surrounding content but starts a new line. Included pages cannot have ) in the title to avoid ambiguity. There may be some cases where this may not produce the expected results because the context of the included page is not used and some content and macros depend on that. For instance, finding attachments or page properties. User needs to be aware of the consequences and differences of including page source versus including rendered content. Even with that restriction, there are many examples where this will work nicely. Recursion is not supported. Some macro interactions may also not work as expected. For example,cache macro refresh and similar. Examples:

  • $include_page(include) 

  • $include_page(myspacekey:The title of the page to include)

  • $include_page(page_to_include, alternate_page) : If page_to_include does not exist, alternate_page will be considered. (Since v5.4.0)

%property_key%

Property value. See content-properties for more information. Note that on recent versions of Confluence, page properties set using the Page properties macro are no longer stored as Confluence content properties and are no longer available for access. See RUN-205From version 6.4.1, we recommend using the new pre-defined variable %pageproperty_key%.

%metadata_name%

Metadata value. See content-properties for more information.

%contentproperty_myprop.value.variable%

This can be a simple JSON key-value or complex JSON with nested key-value levels. You can access the content properties of the page by replacement variable prefixed with contentproperty_ in RUN Macro body. See RUN-182 for more information.

%pageproperty_key%

Property value. To access the page property values, set the new variable %pageproperty_key%, where the key is the page property ID. Available since 6.4.1.

All the parent page variables ($parent_page_title, $parent_page_id, $parent_page_url, $parent_page_tinyurl) will not be replaced, if no parent page exists for the current page.

Replacement

Replacement occurs for variables found within the body of the macro just prior to rendering the body. It cannot replace variables produced by the rendering process like data produced by downstream macros.

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.