Skip to main content

Variable Reference Guide

Smart variables are dynamic variables that can make your content more flexible. Each smart variable is constructed using a specific syntax called dot notation inside double mustache brackets. It's written as a hierarchy, starting with a top-level object and followed by properties of that object, {{object.property.subProperty}}. Notice that multiword properties use camelCase capitalization.

This {{ }} syntax is Handlebars, so the macro also supports Handlebars' conditionals, loops, and helper functions on top of plain variable interpolation β€” see the Template Syntax guide for examples.

When you're trying to understand what a particular smart variable might do, it can help to read them in reverse. For example:

{{page.title}} is "the title of the page" (that's relevant to the current page).

Space properties​

  • {{space.id}} – the ID number that uniquely identifies a space
  • {{space.key}} – the keyword in the URL that serves as a unique identifier of a space. Example: http://confluence.atlassian.com/wiki/spaces/KEYWORD/pages
  • {{space.name}} – the name of the space
  • {{space.type}} – the type of the space ('global', 'collaboration', 'knowledge_base', 'personal')
  • {{space.status}} – 'current' or 'archived'
  • {{space.authorId}} – accountId of the person who created the space
  • {{space.createdAt}} – space creation date and time
  • {{space.homepageId}} – the ID of the space's homepage

Page properties​

  • {{page.type}} – identifies the type of relevant content as either a β€œpage” or a β€œblogpost”
  • {{page.id}} – the ID number that uniquely identifies a page
  • {{page.title}} – the published title of a page
  • {{page.status}} – 'current', 'archived', 'trashed', 'deleted', 'historical', or 'draft'
  • {{page.createdAt}} – the date and time the page was originally created

Author​

  • {{page.author.accountId}} – accountId of the person who originally published the page
  • {{page.author.username}} – the username of the person who originally published the page
  • {{page.author.publicName}} – the public name of the person who originally published the page (the name or handle they use in public Atlassian forums like Community)
  • {{page.author.displayName}} – the display name of the person who originally published the page (the β€œFull name” in their Atlassian account profile)

Page versions​

Reference {{page.currentVersion}}, {{page.previousVersion}}, or {{page.initialVersion}} to pull details about a specific version of the page β€” no extra configuration needed, the data is fetched automatically the moment you reference one of these paths.

  • {{page.currentVersion}} – the latest published version of the page
  • {{page.previousVersion}} – the version immediately before the current one
  • {{page.initialVersion}} – the very first published version of the page

Each of these exposes the same set of sub-properties, for example on currentVersion:

  • {{page.currentVersion.number}} – the version number
  • {{page.currentVersion.createdAt}} – when this version was published
  • {{page.currentVersion.message}} – the version's edit summary/comment
  • {{page.currentVersion.minorEdit}} – whether the edit was flagged as minor
  • {{page.currentVersion.authorId}} – accountId of the person who published this version
  • {{page.currentVersion.author.accountId}} – accountId of the version author
  • {{page.currentVersion.author.username}} – username of the version author
  • {{page.currentVersion.author.publicName}} – public name of the version author
  • {{page.currentVersion.author.displayName}} – display name of the version author

Replace currentVersion with previousVersion or initialVersion to get the same fields for those versions, e.g. {{page.previousVersion.author.displayName}}.

All page versions​

{{page.versions.results}} returns the full version history of the page (newest first), for use with an {{#each}} loop β€” see Loops in the Template Syntax guide.

Extended page data​

These are fetched on demand β€” just reference one of them in your template and the data is included automatically:

  • {{page.labels.results}} – labels applied to the page
  • {{page.properties.results}} – content properties stored on the page
  • {{page.operations.results}} – operations the current user can perform on the page
  • {{page.likes.results}} – accounts that liked the page

Date and time​

These are always available and don't need a space or page prefix:

  • {{now}} – the current date and time
  • {{today}} – today's date
  • {{yesterday}} – yesterday's date
  • {{tomorrow}} – tomorrow's date