I would like to display the approved version page number followed by the draft version page number.
You can do this by using Comala Document Management and macros installed with the app. The macros
The current version for the page, whether in the workflow draft or approved state is the Confluence page version listed in the page tools menu option Page History
- this is stored as a Confluence metadata data and can be accessed by retrieving the current value using the value reference
We can use this together with the
set-metadata macro to store the page version when the content is approved.
You can then use the
get-metadata macro to retrieve this version value.
Store the approved version
Simply add the following workflow trigger to your Comalatech workflow
This sets a workflow trigger to listen for a
pageapproved event for the content review named ApprovalName.
In our simple workflow, this content review is in the Draft state.
The Confluence content version created when the page is approved will be stored as a value for the metadata named
This will change every time the page is approved if the content has been edited and the Confluence version has changed.
Retrieve and display the draft and approved versions on your page
We have two metadata values
- the current version is the value for the Confluence metadata version
- the version when the last p
ageapprovedevent occurred stored as the value for the metadata approvedversion
We can retrieve these metadata values using the value references
@approvedversion@ using the
You can then display the draft version and the approved version in the
In workflow builder, you can simply add the wiki markup to the Page Header option.
The content will display the draft and the approved versions in a simple table.
Here the latest version is the last approved version. Content is in our simple workflow Approved state.
The Approved state is the final state in our workflow and we have configured the workflow so that if the content is updated the workflow transitions to the Draft state.
Each saved update will change the displayed current version value.
The approved version changes only on the
pageapproved event, setting a new value for the metadata approvedversion. In our workflow, this also actions a transition to the Approved state.
The pipes "|" in the markup create the table on the page
Displaying versions in a published space
In the draft space, you can add the
publish-page macro to the
To copy the draft space page approvedversion metadata to the published (target) space, you will need to
- check Page Properties checkbox in the Comala Publishing Options screen in Space Tools>Publishing Configuration
Lastly, to show pageheader in the Published space, you need to add the following workflow to the published space
You can also use the
increment-metadata macro to create composite versions for your content. The
increment-metadata macro can be used in a workflow trigger and be configured to increment a version value (including options to increment the major, minor and/or patch value of a composite version value).
- Switch between draft and published states
- Comala Publishing for Confluence
- Different-space publishing
- Example - Dynamic page header using a metadata value and triggers
- Example -Use metadata to increment composite major, minor, patch content version on an approval decision requiring a parameter