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


## Overview

> Macro (excerpt)
> 
> Automatically apply workflows, automate label management and trigger actions

As a Confluence user, you will be familiar with the concept of [labels](https://confluence.atlassian.com/doc/add-remove-and-search-for-labels-136419.html#Add,RemoveandSearchforLabels-TheLabeledcontentpage) as a method of [folksonomy](https://www.wikiwand.com/en/Folksonomy), but they can also be integrated with your workflows in order to

- Automatically apply workflows
- Enable or disable workflow functions
- Add or remove labels in response to [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655)
- Perform [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941) when labels are added or removed
- Make labels "sticky", which prevents their removal
- Ensure compliance with content labelling policy

## Automatic workflow application

To use this feature, the workflow must be added and enabled in the space document management dashboard (the workflow is applied in [space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846)).

Use the `label` and, optionally, `invertlabel` parameters of the [workflow macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662219) to specify which labels the workflow should or should not be applied to.

In the space document management dashboard, you can use the workflow builder visual editor to add one or label content filters to a space workflow.

![image](media://35fc3064-b52d-43f0-8bf4-0823c7c14788)

This workflow will be applied automatically to any content with the label **hr_kpi** and/or **hr_obj**.

> ℹ️ Check the **Invert labels** option to automatically apply to any content *that does not have* either of the labels **hr_kpi** or **hr_obj**.

Label filters added to a workflow are displayed in the workflow listing in the document management dashboard.

![image](media://0a6c724b-df81-4fee-9923-dc9c083ec3b7)

The **Human Resources Team kpi and objectives workflow** will be applied to documents in the space that have either the **hr_kpi** or the **hr_obj** label added.

![image](media://db77cf3d-a38f-4a69-8acf-4b2d066e282e)

> 📝 When using content labels to apply workflows across space content, all enabled workflows in the space must use a content label filter otherwise an enabled workflow  in the space without a content label filter will take priority and be applied.

## Enable or disable workflow features

Any macro which supports [conditions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694110) can be disabled or deactivated by the `haslabel` condition.

For example, you can disable state selection or reviews if labels are missing:

Conditions for an approval and the state selection transition can be added using the workflow builder visual editor.

**Select transition condition**

One or more conditions can be included when adding a select transition for a state in the [workflow builder visual editor](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649923009).

For a workflow with an **Initial** state with a select transition to the **Review** state:

![image](media://061e23d7-9525-4ddd-bab1-ad3d95edb6fd)

With an **haslabel** condition requiring the label **review** on the page, the select transition is not active on the page in the **Initial** state workflow popup if the label **review** has not been added to the page.

![image](media://11878167-a82d-4712-b994-a0db23087c36)

Adding the label **review** to the page meets the select transition condition and the workflow popup displays the select transition option.

![image](media://b9002d08-60c7-4cd4-a878-4730e645ca40)

> 📝 A condition cannot be added to an existing select transition in a workflow in the workflow builder visual editor. You must *either* remove the select transition and then add again with the required condition or add the condition using the markup editor. Adding the condition in the markup editor updates the select transition in the workflow builder visual editor.

**Approval condition**

One or more conditions can be added to an approval in the [workflow builder visual editor](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650152120).

![image](media://72ce4822-7f9c-489f-8d5f-706e827a90b7)

The added **haslabel** condition for the label **review** has the **Invert **option checked. The **Review** approval in the **Review** state is only active on the page in the workflow popup if the label **review** is not on the page.

Both the **Approved** and **Rejected** buttons are disabled in the workflow popup.

![image](media://4ee54876-149f-4c84-bfaf-f9fc131ffdf8)

Removing the label from the page enables the **Approved** and **Rejected** buttons for the approval.

## Adding and removing labels

You can use [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) to [Trigger](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) the [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941) which can add or remove labels.

## Trigger actions when labels change

When labels are added or removed from a page, the `labeladded` or `labelremoved` [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) are sent. [Triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) listening for those events can determine which label was added or removed via the `@label@`, `@addedlabel@` or `@removedlabel@`  [Event references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649925434).

## Value references

You can access extensive information about content labels by accessing the [Label Supplier](https://appfire.atlassian.net/wiki/spaces/SUPSR/pages/479036173) via a [Supplier Reference](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649532510) (requires [ServiceRocket Reporting for Confluence app](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759324)).

## Sticky labels

You can prevent labels from being removed (but [admins](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217543) can still remove them) by using the `stickylabels` parameter on the [workflow macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662219).

One or more “**sticky labels**” can be added for a workflow using the workflow builder visual editor.

![image](media://7ae5eaec-1977-478d-9911-97a4dceeb6e7)

> 📝 If the workflow uses the trigger action `remove-label` to remove a label defined by the `stickylabels` parameter, the label will only be removed when the workflow event the trigger was listening for is actioned by a user with appropriate admin permission.

## Content labelling compliance

In situations where business or regulatory compliance mandates a content labelling policy, you can enforce that via the workflow.

> ✅ If all documents (pages) relating to a specific regulation must be labelled, you can either make the workflow add those labels, or require that content be labelled in order for the workflow to be automatically applied.

Our existing customers use the [workflow-instructions macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650119824) to convey content labelling policy to content producers at the point of initial content creation. 

Workflow instructions can be added to a workflow using the **Workflow Instructions** option in **Page Layout** in [workflow builder visual editor](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649693867).

![image](media://c9e747f1-2643-46bd-aea8-20c0916b7fe0)

> 📝 Workflow instructions does not work if the workflow application is content label-filtered.

## Macros

> Macro (contentbylabel)

## Events

Label changes will generate [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655), which can be used to [Trigger](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941):

- `labeladded`
- `labelremoved`

## Value references

Information about labels can be obtained from [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302):

- [Event references](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649925434)
- [Supplier References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649532510)

## Examples

> Macro (contentbylabel)

## See also

[Workflow Authoring Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648611901):

- [Templates](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649628549)
- [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425)
- [Approvals](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766)
- [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655)
- [Triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178)
- [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941)

[Administration Guides](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649233819):

- [Space Mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846)
- [Document Management - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649827041)
- [Workflows - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649530159)

Atlassian Marketplace:

- [Label Manager for Confluence](https://marketplace.atlassian.com/plugins/com.kostebekteknoloji.plugins.confluence.confluence-label-manager/server/overview)
- [Label Tools for ScriptRunner Confluence](https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.labeltools/server/overview)