Space and global variables

Every variable belongs to a scope, chosen when you create it. The scope decides which pages can use it and who can read it.


#The two scopes

Scope

Where it is kept

Which pages can show it

Who can create one

Space variables

In that space

Pages in the same space

People who can add pages in the space

Global variables

In the Capable Asset Store space

Any page in any space

People who can add pages in the Capable Asset Store space


#Choosing a scope

  • Use a space variable for something only one team or product needs, such as that product's current version.

  • Use a global variable for something the whole organisation quotes, such as a support phone number or company-wide policy figure.

The scope is fixed once the variable exists. To move a value to the other scope, create a new variable there and point the pages at it. See Retire or replace a variable safely.


#Names are unique within a scope

Two variables in the same scope cannot share a name, ignoring case: Product Version and product version count as the same. A space variable and a global variable can share a name, and different spaces can each have their own variable with the same name.


#A few things that catch people out

  • To read a global variable, people need View access to the Capable Asset Store space. Without it they see [unavailable] wherever the value appears. See Global variables are unavailable.

  • The picker offers the current page's space variables plus global variables. A space variable from another space is not offered.

  • Variables are stored as Confluence content, so they follow the same space permissions, trash and version history as pages.



One space, or every space.