publish-page macro

Overview

Use the publish-page trigger action to publish documents to a different space when you need greater flexibility and control over when and where content is published. It’s ideal for use in complex workflows and staged content releases.

The publish-page macro is used in a workflow trigger to publish content using the Comala Publishing app, publishing a page to a different space on the same Confluence Server or Data Center instance.

  • one space is set up as the source space, where content is drafted, developed, produced, and approved

  • another space is set up as the destination target space, where the content is published for broader audience viewing

For more information, see Different-space Publishing.

Requirements

You must install the Comala Publishing app to use this macro.

Where to use it?

Optional.

One publish-page macro can be put in a trigger macro.

The publish-page macro action gives you granular control over when and how pages are published. This action is linked to specific transitions between workflow states, allowing you to trigger the publishing process at a precise point in your workflow.

If using the Comala Publishing publish-page macro to publish content with metadata references to a different space, the publish-page macro action and any metadata modification macro action must be in a separate trigger to ensure the metadata is updated on the published space page. The metadata modification macro, such as the set-metadata macro or the set-label macro, must be in a trigger that appears in the workflow before the trigger containing the publish-page macro.

Parameters

The macro has no parameters; it uses the publishing profile defined in the space tools Publishing dashboard (if Comala Publishing is installed).

For more information, see Different-space publishing.

Basic examples

{workflow:name=Different-space publishing} {state:Editing|submit=Review} {state} {state:Review|approved=Published|rejected=Editing} {approval:Review} {state} {state:Published|update=Editing|final=true} {state} {trigger:statechanged|state=Published} {publish-page} {trigger} {workflow}

The final=true parameter on the Published state is not required for different-space publishing using the publish-page macro, however it helps to clarify which versions of content are published from the source space.

You can add separate triggers when you need to update page metadata, such as the page label, and include it on the published page:

{workflow:name=Different-space publishing} {state:Editing|submit=Review} {state} {state:Review|approved=Published|rejected=Editing} {approval:Review} {state} {state:Published|update=Editing|final=true} {state} {trigger:statechanged|state=Published} {set-label:published} {trigger} {trigger:statechanged|state=Published} {publish-page} {trigger} {workflow}

The order in which triggers for the same workflow event are added to the workflow determines the order in which they are executed. The label is added on the state change to Published in the first trigger. The page is then published using the second trigger.

Here’s a simple example if you want to publish documents to a different space at several stages in your documentation process to stage the release of content:

{workflow:name=Different-space publishing} {state:Editing|submit=Review} {state} {state:Review|approved=First Publishing|rejected=Editing} {approval:Review} {state} {state:First Publishing|approved=Second Publishing|rejected=Editing} {approval:Final Review} {state} {state:Second Publishing|update=Editing|final=true} {state} {trigger:statechanged|state=First Publishing} {set-label:first} {trigger} {trigger:statechanged|state=First Publishing} {publish-page} {trigger} {trigger:statechanged|state=Second Publishing} {set-label:second} {trigger} {trigger:statechanged|state=Second Publishing} {publish-page} {trigger} {workflow}

Both triggers in the example publish the page in the same Confluence target space. You cannot publish to different spaces unless you manually reconfigure the Comala Publishing app.

However, you can configure the second publishing action to publish to a remote space using the Comala Remote Publishing app and the remotepublish-page action macro. For more details, see Remote-space Publishing.

All examples

See also

Publishing

Comala Publishing app documentation

Other links