The Adaptavist Group LogoDocumentation

Converting Include Pages Macro to Include Version

It's difficult to manage multiple Include Page macros on one page. A REST endpoint is included in ScriptRunner for Confluence, which converts all instances of Include Page to Include Version.

The version number is specified to be the current latest version, so the page contents should be identical in all instances. The page contents remain identical until one of the includes is modified.

Create the REST endpoint

You can easily hook up this REST endpoint using a web item. Follow these steps to create the web item:

  1. Navigate to General ConfigurationScriptRunnerFragments.
  2. Click Create Fragment, and then click Custom Web Item.
  3. Fill out the fields that appear in the image:
    Note: Help with Condition and Link fields

    For the code in the Condition field, select Example Scripts and then copy the Current page contains particular macros code.

    The text for the Link field is /rest/scriptrunner-confluence/latest/content-info/convert-includes?pageId=${page.id}&#url_xsrfToken().

  4. Click Add.

The following image is the result of this web item being configured:

Note: This result only appears on the pages that contain the Include Page macro.

Search documentation

Start typing to search the docs.