Versions Compared

Key

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

Syntax

createPage(spaceKey, parentPageId, pageTitle, pageContent)

...

Excerpt

 Creates an issue based on the provided arguments.

Parameters

Parameter name

Type

Required

Description

space key

stringyesKey of space to create the new page in.
parent page IDnumberyesThe ID of the parent page. If the page is at the root level (top level) the parent page should be the spaces home page.
page titlestringyesTitle of the new page.
page contentstringyesContent to be displayed on the new page.

Return type

number

The page ID of the newly created page.

Example

Example 1

Code Block
string spaceKey = "PSCONF";

number parentPageId = 11801;
string pageTitle = "New Page";
string pageContent = "<p>This page was created by Power Scripts!<p>";


number newPage = createPage(spaceKey, parentPageId, pageTitle, pageContent);


%newPage%.labels += "new";

...

Code Block
number homePage = getPage("PSCONF", "Power Scripts for Confluence Home");


number newPage = createPage(%homePage%.space, %homePage%.id, "New Page", %homePage%.content);


%newPage%.labels += "new";

...