Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Overview
Excerpt | ||
---|---|---|
| ||
Define pre-requisite conditions for approvals, select transitions and triggers |
Conditions allow you to specify additional prerequisite requirements for Triggers and some Transitions.
They are a set of optional parameters which that can be added to the macros (listed below) to impose additional limits on when the macro will be is active.
In addition, due to support for Value References, you can even create your own custom conditions by comparing metadata values.
Basic example
Code Block | ||
---|---|---|
| ||
{workflow:name=Conditions} {state:Editing|approved=Done|rejected=Editing} {approval:Review|group=confluence-administrators|assignable=true} {state} {state:Done|final=true|updated=Editing} {state} {workflow} |
In the example above, only a user who is a member of the confluence-administrators group can review the content.
Compatible Macros
Note: If a macro has a parameter of the same name as a condition, the parameter – and documentation for that parameter on the macro page – takes precedence.
|
Conditions
Condition
Value
Notes
Ver
If a macro has a parameter with the same name as a condition, the parameter as defined in the macro takes precedence. For example, |
Conditions
Condition | Value | Notes | Ver | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A specific value, of valid type . This must be a valid datatype for the value reference.
| Does the value of a value reference match the specified value? Filter by label (Content by label) | | showLabels |
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
If used in a trigger macro that's listening to for the pageupdated
event, the trigger will is not be activated if the referenced value is still being updated.
One invalid parameter in a list of users in a conditionWILL disable disables the transition for the other listed users. The non-existent parameter value is a blocker for an approval or a state-selection transition.
group
†
A comma-separated list of group names
Supports supports Value References
Is the current user a member of one or more of the specified groups?
When applied to the approval macro, it is an a parameter of the approval macro parameter - it is not used as a condition.
For example, you can prefix the list (not items in the list) with &
(ampersand) to mandate that all users in the groups defined by the list must take part in the content review.
hasapproval
Name of an approval
Has an approval
of the specified name been Approved approved for this content?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
When applied to an approval macro in a state with multiple approval
macros, this enables you to create nested approvals. Just make sure the approval you are referring to is defined prior to where the condition is used.
haslabel
A comma-separated list of content labels.
Does the content have one or more of the labels specified?
initial
true
– Yes, this listens ONLY for the first occurrence of a transition to a specified state for the contentfalse
– No, the filter listens for all occurrences of transitions to the specified state
Is this action in a trigger only for only the initial occurrence of the named state for the content?
initial
is unique to thestatechanged
event used in a trigger macro trigger macroinitial=true
acts as a filter to make the trigger act only on the first occasion that a state is entered for a given piece of contentinitial=false
listens to every time the workflow transitions to the state specified by thestate
parameter.
The use of initial
is as a parameter of the trigger macro.
The primary use of the initial
parameter is to perform one-time initialisation initialization actions for a given piece of contentdocument. For example, on the first review of a piece of content document, you might want to send out an additional emails, email or set some metadata.
ischildof
Title of required ancestor page.
Supports supports Value References
Does the current page have a parent or ancestor page of the specified page title?
ishomepage
true
– Yes, it's the home pagefalse
– No, some other page
Is this page set as the space home page?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
See also: How to set space home page
isminorchange
true
– Yes, the change was minorfalse
– No, watchers were notified
Did the content editor uncheck the "Notify watchers" checkbox (indicating a "minor change") before updating the content?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
The isminorchange
parameter can be used with the StiltSoft Talk app for changes any change in an inline comments comment on a page or blog post.
This condition can only be used in a trigger macro when listening to either the pageupdated
or newsupdated
event.
isorphan
true
– Yes, the page is an orphanfalse
– No, the page has a parent page
Is the page an orphan (no parent page)?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
parenthaslabel
A comma-separated list of content labels.
Does the parent (or any ancestor pages) have one or more of the labels specified?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
partial
true
– Yes, an individual Approve/Reject decision has been completed for a content reviewfalse
– No, all approval decisions (approve/reject) must be completed
Has an individual reviewer undertaken an Approve/Reject decision?
partial
is unique to content review events in a trigger macrotrigger macro
This condition acts as a filter to tell the trigger to act on each individual Approve or Reject decision, rather than waiting on all reviewers to agree for the named content review.
The use of partial
is only as a parameter of the trigger macro.
permission
edit
– user can edit the contentview
– user can view content†administer
– user can administrate content‡
Does the user have the specified permission for the content?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
See also: Roles and Permissions
† Irrespective of additional view restrictions resulting from Publishing.
‡ Additional administrators administrator that is defined via the adminusers
parameter on the workflow macro.
space
or spacekey
A space key.
Supports supports Value References
Is the page or blog post in the space defined by the space key?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Info |
---|
The space key is usually shown in URLs |
or on the Space Tools → Space Overview screen. |
state
A state name.
Is the workflow for this content currently in the named state?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
stateindraft
A state name.
Is there an unpublished version of this content in the corresponding Draft Space?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
This condition requires the installation of the Comala Publishing app to be installed.
success
true
– no errors encountered for a trigger actionfalse
– error encountered for a trigger action
Has an error occurred in the action(s )of a workflow trigger?
success
is unique to custom events created using the trigger macro.
This condition acts as a filter for the trigger and looks at whether the actions of the parent trigger for the custom event encountered any errors.
The use of partial
is only as a parameter of the trigger macro.
title
Content title.
Supports Value References
Does the content (page or blog post) have the specified title?
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
user
†
Name of the page
Does the current page have the page name?
This condition does not support the use of value references for its value.
You can use the @title@
value reference as a condition with a value reference as its value, for example, @title@=@ThisisaPageName@
.
user
†
A comma-separated list defines one or more users via their username usernames or user groups.
Supports supports Value References
Is the current user one of the users listed?Note:
Info |
---|
You can include |
One invalid parameter in a list of users in a condition disables the transition for the other listed users. The invalid user parameter value is a blocker for an approval or a state-selection transition.
When applied to the approval macro it is an macro, it is a parameter of the approval macro parameter - it is not used as a condition.
You can prefix the whole list (but not items an item in the list) with &
(ampersand) to mandate that all users in the groups defined by the list must take part in the content review.
usersdefined
Comma-separated list of Value References
Does the value reference define users?
This is useful when using workflowparameter workflow parameter macro to create editable value references – you can check to see if use this parameter to check that the entered values are valid user accounts.
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
4.1
metadata reference
Reference to a metadata value (including a workflow parameter reference)
When comparing metadata (value references), a metadata reference can only be compared against one specific value or a value reference.
Multiple values can ONLY be compared when metadata is used with a user
, group
, or haslabel
condition.
Denotes conditions which that can only be used on pages, not blog posts.
† Conditions are evaluated as AND conditions, with the exception of user and group. When both conditions are used, it's applied an OR clause is applied, i.e., (user or group), and either one of those parameters is required for the condition to be true.
Denotes a parameter in a trigger macro that act acts as a filter. The use of these are is unique to specific events.
Negation
Conditions are compared to values. Values can optionally be negated with a !
(pling / exclamation mark) symbol:
Code Block | ||
---|---|---|
| ||
{...|condition=value|...} -- value must match {...|condition=a,b,c|...} -- one or more of the values must match {...|condition=!value|...} -- value must not match {...|condition=!a,b,c|...} -- none of the values must match |
Comparing metadata values
A metadata reference can only be compared against one specific value or a value reference.
An exception is that multiple values can be compared when using a metadata reference with the following conditions
user
group
haslabel
When comparing the metadata value against multiple values, you should also use the following format
Code Block |
---|
@MetaOne@=!1|@MetaOne@=!2|@MetaOne@=!3 |
For example
Code Block |
---|
{state-selection:states=Approved|user=@MetaOne@=!1|@MetaOne@=!2|@MetaOne@=!3} |
The condition is evaluated as an OR condition.
If a metadata condition is include included in a pageupdated
trigger, the trigger will does not fire if the referred metadata value is being updated.
Invalid workflow parameter for a user
One invalid parameter in a list of users in a condition WILL disabledisables the transition for the other listed users. The non-existent parameter will act acts as a blocker for other users.
Table of Contents | ||||
---|---|---|---|---|
|
Invalid workflow parameter for a user in a condition for a select transition
If a workflow parameter is used to specify a user for a state-select
transition, the transition will be is disabled If the user set in the parameter is invalid (deleted or non-existent).
The transition will become becomes active if the parameter becomes valid by adding a valid value or is deleted.
For example, if the workflow parameter @myParam@
has an invalid user value, the transition button in the workflow popup will be is disabled.
Code Block | ||
---|---|---|
| ||
{state:In Progress|taskable=true} {state-selection:states=Approved|user=@MyParam@} {state} |
If the invalid workflow parameter is one of a list of the users for the state-select
transition, the transition will be is disabled for the other users listed in the condition. The non-existent parameter is a blocker for blocks the transition.
Code Block | ||
---|---|---|
| ||
{state:In Progress|taskable=true} {state-selection:states=Approved|user=@MyParam@, admin, elle} {state} |
An error is shown indicating that there is A message displays an error in the workflow definition regarding the list of users who can undertake the transition.
Invalid workflow parameter in a condition for an approval
If a workflow parameter is used to specify a single user for an approval, the Approve and Reject buttons in the workflow popup will be are disabled if the user set in the parameter is invalid (deleted or non-existent).
Code Block | ||
---|---|---|
| ||
{state:Review|approved=Approved|rejected=Rejected} {approval:Review the page|user=@MyParam@} {state} |
The transition will become active if the parameter becomes valid by adding a valid value or is deleted.
If the invalid parameter is one of a list of users for the approval, then the approval is disabled for all users.
Code Block | ||
---|---|---|
| ||
{state:Review|approved=Approved|rejected=Rejected} {approval:Review the page|assignable=true|user=@MyParam@, admin, elle} {state} |
The non-existent user defined in the parameter blocks the approval.
An error is shown indicating that there is A message displays an error in the workflow definition regarding the list of users who can approve.
The approval will become becomes active for each defined user if the parameter becomes valid by adding a valid value or is deleted.
Examples
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|