Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleAvailability

This routine is available starting with Power Scripts™ for Confluence v1.1.0.

Syntax

getPersistentVar(pageId, varName)  // get page persistent variable

getPersistentVar(varName)          // get global persistent variable

Description

Excerpt

Gets the specified persistent variable as a string.

Parameters

Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

getPersistentVar([issue, ]varName)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Gets the persistent var, as a string

Gets the persistent var, as a string

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

...

issue

...

String

No

...

the issue key

varName

...

String

Yes

...

the variable introduced via 'persistent' keyword

Return

...

Type

string

Returns the value of the specified persistent variable.

Examples

Example 1

This example gets the value of the page persistent variable named "pageViews".

Code Block
const string varName = "pageViews";
const number pageId = getPage("TEST", "Example page");
const number pageViews = getPersistentVar(pageId, varName);  // conversion from string to number is performed automatically

Example 2

This example gets String

Returns the value of the global persistent variable named "globalCounter".

...

...

const string varName = "globalCounter";
const number globalCounter = getPersistentVar(varName);  // conversion from string to number is performed automatically

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "pssystem_conf"routine" and space = currentSpace ( )
labelsjiraarray_comment_routineroutines