Converting Include Pages Macro to Include Version

If you have multiple Include Page macros on a page, it it is difficult to manually update them. 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.

You can easily hook up this REST endpoint using a web item. You can see the fields that you fill out to create a web item in the following image:

The link address of the condition code is:


/rest/scriptrunner-confluence/latest/content-info/convert-includes?pageId=${page.id}&#url_xsrfToken()

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

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