Standard Variables

The standard variables are variables that you use in your scripts to work with the Confluence objects.

Variable

Read Only

Description

Variable

Read Only

Description

space

No

Represents space key the page belongs to (returns empty string if space is missing).

author

No

Represents user key of the page author.

title

No

Represents page title.

version

No

Represents page version.

content

No

Represents page content as a string.

attachments

Yes

Represents page attachments (file names).

created

No

Represents page creation date.

id

Yes

Represents page id.

parent

Yes

Represents parent page id (returns -1 if parent page is missing).

updated

Yes

Represents page last modification date.

watchers

No

Represents an array of users watching the page (usernames, string[]).

labels

No

Represents an array of page labels (string[]).

tinyLink

Yes

Represents a tiny url of a page (e.g. http://localhost:1990/confluence/x/AgAZ).


Example Usage:

Following script takes page title, ensures that the page actually exists and returns basic currently supported standard variables.

if (size(argv) < 2) { return "space key and page title are not specified"; } string spaceKey = argv[0]; string pageTitle = argv[1]; number page = getPage(spaceKey, pageTitle); if (page < 0) { return "space '" + spaceKey + "' has no page '" + pageTitle + "'"; } return "id: " + %page%.id, "parent: " + %page%.parent, "title: " + %page%.title, "space: " + %page%.space, "author: " + %page%.author, "version: " + %page%.version, "content: " + %page%.content, "attachments: " + %page%.attachments, "created: " + %page%.created, "updated: " + %page%.updated, "watchers: " + %page%.watchers, "labels: " + %page%.labels, "tinyLink: " + %page%.tinyLink;



Peacock