---
title: "Conditions"
canonical: "https://support.appfire.com/space/CDML/649694110/Conditions"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Define prerequisite conditions for approvals, select transitions, and triggers

Conditions let you specify additional prerequisite requirements for [triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) and some [transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425).

They are a set of optional parameters that can be added to a workflow macro (listed below) to impose additional limits on when the macro is active.

In addition, due to support for the use of [value references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) in some conditions, you can create custom conditions by comparing metadata values.


## Conditions

| **Condition** | **Value** | **Notes** | **Ver** |
| --- | --- | --- | --- |
| *[Value Reference](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302)* | A specific value. This must be a valid datatype for the value reference.<br>- Supports use of another [value reference](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) as a value | Does the value of a value reference match the specified value?<br>For example, `@title@=<pagename>` where <*pagename*> is the page title.<br>Conditions using value references can also be set when using a third-party app:<br>> Macro (contentbylabel) |  |
| If used in a [trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133) that's listening for the `pageupdated` [event](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655), the trigger is not activated if the referenced value is still being updated. |  |
| One invalid parameter* in a list of users in a condition*** disables** the transition for the other listed users. The non-existent parameter value is a blocker for an [approval](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766) or a [state-selection ](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649891610)transition. |  |
| `group`† | A comma-separated list of group names<br>- Supports [value references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | Is the current user a member of one or more of the specified groups? |  |
| When applied to the [approval macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337), it is a parameter of the approval macro - **it is not used as a condition**.<br>For example, you can prefix the first item in 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](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766) | Has an `approval` of the specified name been approved for this content?<br>> Macro (contentbylabel) |  |
| When applied to an [approval macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337) 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` :green_star: | - `true` – Yes, this listens ONLY for the first occurrence of a transition to a specified state for the content
- `false` – No, the filter listens for all occurrences of transitions to the specified state | Is this action only for the initial occurrence of the named state for the content?<br>- `initial` is unique to the `statechanged` event used in a [trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133)
- `initial=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 content
- `initial=false `listens to every time the workflow transitions to the **state** specified by the `state` parameter. |  |
| The use of `initial` is as a parameter of the trigger macro.<br>The primary use of the `initial `parameter is to perform one-time initialization actions for a given document. For example, on the first review of a document, you might want to send out an additional email or set some metadata. |  |
| `ischildof` :info: | Title of required ancestor page.<br>- Supports [value references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | Does the current page have a parent or ancestor page of the specified page title? |  |
| `ishomepage` :info: | - `true` – Yes, it's the home page
- `false` – No, some other page | Is this page set as the space home page?<br>See also: [How to set space home page](https://confluence.atlassian.com/doc/set-up-a-space-home-page-829076213.html#SetupaSpaceHomePage-spacehomepageSetanotherpageasyourhomepage) |  |
| `isminorchange` | - `true` – Yes, the change was minor
- `false` – No, watchers were notified | Did the content editor uncheck the **Notify watchers** checkbox (indicating a *minor change*) before updating the content?<br>> Macro (contentbylabel)<br>The `isminorchange` parameter can be used with the [StiltSoft Talk app](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649826573) for any change in an inline comment on a page or blog post. |  |
| This condition can only be used in a [trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133) when listening to either the `pageupdated` or `newsupdated` [event](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655). |  |
| `isorphan` :info: | - `true` – Yes, the page is an orphan
- `false` – No, the page has a parent page | Is the page an orphan (no parent page)? |  |
| `parenthaslabel` | A comma-separated list of content labels. | Does the parent (or any ancestor pages) have one or more of the labels specified?<br>> Macro (contentbylabel) |  |
| `partial` :green_star: | - `true` – Yes, an individual **Approve** or **Reject **decision has been completed for a content review
- `false` – No, all approval decisions (**Approve** or **Reject**) must be agreed and completed | Has an individual reviewer undertaken an **Approve** or **Reject** decision?<br>- `partial` is unique to [content review events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) in a** **[trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133)<br>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 content
- `view` – user can view content<sup>†</sup>
- `administer` – user can administrate content<sup>‡</sup> | Does the user have the specified permission for the content?<br>> Macro (contentbylabel)<br>See also: [Roles and Permissions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217543) |  |
| † Irrespective of additional view restrictions resulting from [Publishing](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649923873).<br>‡ Additional administrator that is defined via the `adminusers` parameter on the [workflow macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662219). |  |
| `space` or `spacekey` | A space key.<br>- Supports [value references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | Is the page or blog post in the space defined by the space key?<br>> Macro (contentbylabel)<br>> ℹ️ The space key is usually shown in the instance URL or on the *Space Tools* > *Space Overview* screen. |  |
| `state` | A **state** name. | Is the workflow for this content currently in the named [state](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649595551)?<br>> Macro (contentbylabel) |  |
| `stateindraft` | A **state** name. | Is there an unpublished version of this content in the corresponding *Draft Space*?<br>> Macro (contentbylabel) |  |
| This condition requires the installation of the [Comala Publishing app](https://appfire.atlassian.net/wiki/spaces/AHP). |  |
| `success` :green_star: | - `true` – no errors encountered for a trigger action
- `false` – error encountered for a trigger action | Has an error occurred in the action(s )of a workflow trigger?<br>- `success` is unique to **custom events **created using the **trigger** **macro**.<br>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` | Name of the page | Does the current page have the page name?<br>> 📝 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 usernames or user groups.<br>- supports [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | Is the current user one of the users listed?<br>> ℹ️ You can include `anonymous` if you want to check for users who are not currently logged in to Confluence.<br>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](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766) or a [state-selection ](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649891610)transition. |  |
| When applied to the [approval macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337), it is a parameter of the approval macro - **it is not used as a condition**.<br>You can prefix the whole list (but not 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](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | Does the value reference define users?<br>This is useful when using [workflow parameter macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650348884) to create editable value references – you can use this parameter to check that the entered values are valid user accounts.<br>> Macro (contentbylabel) |  |
| metadata reference | Reference to a metadata value (including a [workflow parameter reference](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760641)) | When comparing metadata (value references), a metadata reference can only be compared against **one specific value or a value reference.**<br>> 📝 Multiple values can ONLY be compared when metadata is used with a `user`, `group`, or `haslabel` condition. |  |
| :info: Denotes conditions that can only be used on pages, not blog posts.<br>†  Conditions are evaluated as AND conditions, with the exception of *user* and *group*. When both conditions are used, an OR clause is applied, i.e., (*user* or *group*), and either one of those parameters is required for the condition to be true. |  |
| :green_star: Denotes a parameter in a trigger macro[ ](#)that acts as a filter. The use of these is unique to specific [events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655). |  |

## Negation

Conditions are compared to values. Values can optionally be negated with a `!` (exclamation mark) symbol:

```erlang
{...|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

```
@MetaOne@=!1|@MetaOne@=!2|@MetaOne@=!3
```

For example

```
{state-selection:states=Approved|user=@MetaOne@=!1|@MetaOne@=!2|@MetaOne@=!3}
```

The condition is evaluated as an **OR** condition.

> 📝 If a metadata condition is included in a `pageupdated` trigger, the trigger does not fire if the referred metadata value is being updated.

## Invalid workflow parameter for a user

<span style="color: #172b4d">One invalid parameter</span>* in a list of users in a condition ***disables**<span style="color: #172b4d"> the transition for the other listed users. The non-existent parameter acts as a blocker for other users.</span>

### Invalid workflow parameter for a user in a condition for a **select** transition

When editing a workflow, if a [workflow parameter](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760641) is used to specify a user for a `state-select` transition, the transition is inactive on the page when one of the users set in the parameter is invalid (deleted or non-existent). The transition becomes active by replacing this invalid value with a valid username, or, deleting the invalid value.

For example, if the workflow parameter `@myParam@` has an invalid user value, the transition button in the workflow state dialog box is disabled.

```plaintext
{state:In Progress|taskable=true}
        {state-selection:states=Approved|user=@MyParam@}
{state}
```

If the invalid [workflow parameter](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760641) is one of the users for the `state-select` transition, the transition is disabled for the other users listed in the condition. <span style="color: #172b4d">The non-existent parameter blocks the transition.</span>

```plaintext
{state:In Progress|taskable=true}
        {state-selection:states=Approved|user=@MyParam@, admin, elle}
{state}
```

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 state dialog box are disabled if the user set in the parameter is invalid (deleted or non-existent).

```plaintext
{state:Review|approved=Approved|rejected=Rejected}
        {approval:Review the page|user=@MyParam@}
{state}
```

The transition becomes active if the parameter becomes valid by adding a valid value or the invalid value is deleted.

```plaintext
{state:Review|approved=Approved|rejected=Rejected}
        {approval:Review the page|assignable=true|user=@MyParam@, admin, elle}
{state}
```

> 📝 If the invalid parameter is one of a list of users for the approval, then the approval is **disabled for all users**.

The non-existent user defined in the parameter blocks the approval.

A message displays an error in the workflow definition regarding the list of users who can approve.

The approval becomes active for each defined user if the parameter becomes valid by replacing it with a valid value or this invalid value is deleted.

## Examples

> Macro (contentbylabel)

## Related pages

- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302)
- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178)
- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766)
- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425)