workflowparameter macro

workflowparameter macro

Overview

The workflow parameter macro lets you create editable value references.

This feature lets you create configurable, portable workflows that can be used across spaces. Each space then has the option to use the default value set in the workflow or to use a custom value specified for that space only.

A workflow parameter can be configured to act as a placeholder for a type of data value, for example, a due date value; a Confluence user name(s) value ; a Confluence group name(s) value; a text string value; or a list of set option values.

Where to use it?

Optional.

One or more workflowparameter macros can be put in a workflow macro.

Must be placed before the state macro(s) in the workflow markup.

Workflow builder can be used to add one or more workflow parameters to a workflow.

Workflow parameters are useful placeholders for values such as content expiry dates or approval reviewers.

The values for these placeholders can be set differently for individual spaces or when the workflow is applied to individual pages without the need to edit the workflow itself.

Where can parameter values be edited?

Where you can edit a parameter value depends on the workflow parameter. The use of the updated parameter value depends on the workflow and how the workflow is applied

Space administrator

The space administrator can view workflow parameters and their current value in the space in the space Parameters screen:

spacedocumentmanagementdashboard_parameters_twoaddedparameter.png

For a workflow parameter to be added to the Parameters screen, a default value must have been added to the workflow. The workflow parameters in a page workflow and a space workflow are on this screen.

A space workflow retrieves the value set in the Parameters screen only on a related workflow event, such as when the workflow is first applied to a page.

Changing the workflow parameter in the parameters screen

  • Does not change the default value set in a workflow template, or

  • Does not update the value used in an applied workflow unless a related workflow event occurs to retrieve the updated workflow parameter value

Users

Users can edit a workflow parameter value using the workflow state dialog box for a space workflow and a page workflow.

If a workflow parameter is configured as editable, a user can edit the parameter value using

  • The three-dot menu option in the workflow state dialog box

  • using the page tools Edit Parameters option

When a workflow is applied as a space workflow for the first time, if the workflow parameter is configured as editable, a user is prompted to add or confirm the workflow parameter value(s) when adding the workflow to content

If a workflow parameter value has been edited in the space Parameters screen, the new value is used by the workflow the next time the workflow action to retrieve the parameter value occurs.

Parameters

The workflow parameter must be defined with a unique name and the type of data used for its value. This can be done using the Parameters editor in the workflow builder

Options let you set a default value, add a description, and let a user edit the workflow parameter value.

Parameter

Required

Default

Notes

Ver

Parameter

Required

Default

Notes

Ver

unnamed first parameter
or name



Name of the parameter.

 

macro body

 



The default value for the parameter

 

description





The description for the parameter

  • Plain text

  • Can use any character set supported by your Confluence instance – except some reserved characters

 

edit



false

Should this parameter be editable at the page or blog post level?

If set to true, the value of the parameter can be used as a normal value reference and can be accessed using the get-metadata macro.

edit=true can also be required to be set upon transition to a state by setting this in the requiredparams list for that state.

 

type



string

Parameter type

  • string – text

    • Usually plain text, but can contain wiki notation depending on where the parameter value will be used

  • user – A single username or comma-separated list of usernames

  • duration – An ISO 8601 duration

  • group – A single Confluence group or comma-separated list of group names

  • list – A list of values to choose from – see: options parameter below

 

options

string

Required if the parameter type is list.

List options

 

Parameter values and unprocessed content

When adding a space workflow, a parameter reference value might only be available for use by the workflow after a workflow process occurs, such as a state transition.

Because of this, the initial state should not include the use of the parameter reference value for use in this first state, as these values might not be available until after a workflow process has taken place.

For example, the workflow might not work as expected, or block your workflow process, if the initial state

  • has a due date, and a workflow parameter value is used to set this expiry

  • Has an approval with pre-assigned reviewers configured to use a workflow parameter value

To process content and ensure workflow parameter values are set up, a space administrator can choose to Initialize states when applying a space workflow. This action processes the pages, and the workflow parameter value is then available for use by the workflow in the initial state. This is a manual job, and it is usually better to avoid using parameters in the initial state to avoid the need for this every time you apply a new space workflow.

Events

The following events are generated when page-level parameters are updated

  • pageparameterupdate

A workflow trigger can be configured to listen for this event.

Examples

When the following workflow is first added to a space, a space administrator can edit the value in the Parameters screen:

  • Workflow parameters type=group and type=users can be used to define different users when adding the workflow to content

  • This can allow a workflow to be used across multiple spaces by different teams without having to change the workflow

A new value for the parameter added to the Parameters screen is used when the workflow is added to the content.

{workflow:name=Parameters} {workflowparameter:Review Group|type=group} confluence-users {workflowparameter} {state:Test} {approval:Review|group=@Review Group@} {state} {workflow}

The workflow parameter must have a value set in the workflow for it to be added and editable in the space tools parameters screend.

Editing the parameter value in the space parameters screen does not change the value used in a workflow that has already been added and applied to content in the space.

Adding edit=true allows end-users to edit the value at the page or blog post level, both in page mode and space mode.

{workflow:name=Parameters} {workflowparameter:Review Group|type=group|edit=true} confluence-users {workflowparameter} {state:Test} {approval:Review|group=@Review Group@} {state} {workflow}

Both group and user type workflow parameters accept comma-separated lists.

These lists can then be used in approval conditions.

{workflow:name=Parameters} {workflowparameter:Review Groups|type=group} group-1,group-2,group-3 {workflowparameter} {state:Test} {approval:Review|group=@Review Groups@} {state} {workflow}

For a type=list workflow parameter, the list options are added using the list parameter.

{workflowparameter:OpDivision|description=Business Operating Division|type=list|options=hr,dev,marketing,finance,global} global {workflowparameter}

Use cases

Related pages

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.