Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel3
minLevel2
absoluteUrltrue
typeflat
separatorpipe

...

  • initialize a version value using the set-metadata macro

  • increment the version value using the increment-metadata macro using different triggers for each element of a composite version number

You will need to refresh the page content to view changes in the metadata value if you use the get-metadata macro on the page to display the metadata value.

Info

These examples only work when the workflow is applied as a space workflow. The space workflow must be active to listen for the pagecreated event to initialize the metadata value.

...

The metadata value is linked to a page not a Confluence page version so when viewing a previous page version this will show the current metadata value. This is NOT the metadata value when the content was published.

Composite major-minor version content

Code Block
languagetext
{workflow:name=Increment a Metadata Version major minor}
    {description}
        A simple approval workflow with use of increment-metadata macro to set the major and minor versions. Major version incremented on approval of content, minor version on any update on the approved content
    {description}
    {state:Review|approved=Approved|taskable=true}
        {approval:Review}
    {state}
    {state:Rejected|submit=Review|taskable=true}
    {state}
    {state:Approved|final=true|updated=Review|hideselection=true}
    {state}
    {trigger:pagecreated}
        {set-metadata:currentversion}0.0{set-metadata}
    {trigger}
    {trigger:pageupdated}
        {increment-metadata:currentversion|increment=0.1}
    {trigger}
    {trigger:pageapproved|approval=Review}
        {increment-metadata:currentversion|increment=1.0}
    {trigger}
{workflow}

...