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


> Macro (excerpt)
> 
> Tasks can be created by users in a workflow state (when the state is set as taskable) or added automatically by the workflow. By default, added tasks are persistent until deleted or completed

## Overview

Comala Document Management introduces the concept of "workflow tasks".

They have similar functionality to Confluence tasks, but they don't clutter up the content.

If present, workflow tasks are displayed in the [tasks dialog box](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649824290) accessed using the tasks breadcrumb.

![Screenshot 2024-02-07 at 17.39.42.png](media://232034bb-7328-4a73-91d5-62c787c20fe3)

While mostly a tool for content producers to interact with using the user interface, the workflow itself can also interact with tasks.

A task can be created

- by users in a workflow state (when the state is set as `taskable`)
- or added automatically by the workflow

> ℹ️ By default, added tasks are persistent until deleted or completed.

## Workflow tasks versus Confluence tasks

Workflow tasks share many similarities with Confluence tasks:

- They have a caption that explains what needs to be done
- They can be assigned to someone (using an **@mention** while creating the task, or by assigning someone to an existing task)
- They can have a due date

However, there are some important differences:

- Document Management workflow tasks are separate from the content, so you don't need to put the task in the wiki page or blog post
- They can have a description to provide additional detail about the task
- They create internal [events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655), which can be used to [t](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655)[rigger](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178)[ actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941), such as causing a state transition when all tasks are completed
- They can be interlinked with the workflow; for example, a content review can be [blocked until tasks are completed](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649727359)
- The notifications associated with them can be customized to the requirements of the workflow

## Creating tasks

Tasks can be [created by users](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759190), but only in [States](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649595551) that are set as `taskable`.

Tasks can also be created by the workflow itself, using the [task macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650315819).

```plaintext
{workflow:name=Tasks}
   {state:Taskable|taskable=true}
   {state}
   {state:Macro}
      {task:This was created by task macro}
   {state}
{workflow}
```

In this example, the user can create tasks in the **Taskable** state but not the **Macro** state because the **Macro** state is not `taskable=true`. When the workflow transitions *into* the **Macro** state, it adds its own task.

The workflow can be configured to [add one or more tasks on the transition to a workflow state](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650118713) using the workflow builder.

![cdm_wfbuilder_addtask_assignee_duedate.png](media://b198aeec-c8ed-4d93-9869-3fbcdd6362d8)

Tasks to be added on the transition into a state are listed for that state in the workflow builder.

![cdm_wfbuilder_inprorgress _state_3 tasks.png](media://29d36bcc-4418-4ef0-9add-00e315cfe59d)

### Page mode

In [page mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649628831), be aware that when editing the workflow and adding a task in workflow builder to the current state of a workflow, it can often give unexpected results.

This is because the `task` macro only works when the state is entered from another state. If you edit the task in a state  (in workflow builder, or the `task` macro directly in the markup editor) in the state the document is currently in, it does not add a task. You need to transition away from that state first, and then back into it, for the task to be added.

> ✅ You can use the [Administrator state override](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760835) to quickly transition between states.

## Completing tasks

The [complete-task macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650251348) can be used in an [event](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) [trigger](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) to automatically complete a specific task.

```plaintext
{workflow:name=Tasks}
   {state:Taskable|taskable=true}
   {state}
   {state:Macro}
      {task:This was created by task macro}
   {state}
   {state:Published}
   {state}
   {trigger:statechanged|state=Published}
      {complete-task:task=This task was created by task macro|comment=Auto-complete}
   {trigger}
{workflow}
```

In this example, transitioning to the **Published** state automatically completes the task added by the macro state, if it is not already completed.

If the task is already completed, the `complete-task` macro just ignores it.

> 📝 Depending on the event that triggered the action, the [document activity report](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649891440) can show the Comala Document Management user as the user who initiated the task event.

## Transition when tasks completed

The [state macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575) can be set to automatically transition to another state when all tasks have been `completed`.

```plaintext
{workflow:name=Tasks}
   {state:Taskable|taskable=true}
   {state}
   {state:Macro|completed=Published}
      {task:This was created by task macro}
   {state}
   {state:Published}
   {state}
{workflow}
```

In this example, as soon as all tasks are completed in the **Macro** state, the workflow transitions to the **Published** state.

The state `completed` parameter for a state can be added by[ editing the state transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649923009) in the workflow builder to add a **Task Completed** transition.

![cdm_wfbuilder_taskcompleted_transition.png](media://254bb785-fb35-4f73-ae52-6248e2148556)

When using this approach, ensure that the state that defines the `completed` parameter adds a task. Otherwise, there might not be any tasks to complete, leaving no way of exiting that state. An alternate would be to include the [state-selection macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649826719) so the user can manually transition out of the state.

## Make tasks disable a review

You can make the presence of incomplete tasks disable the **Approve** and **Reject** buttons in a review by using [Conditions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694110) and [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) on the [approval macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337).

See: [Make tasks disable a review](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649727359)

> ✅ The `state-selection` and `trigger` macros can be disabled in the same way.

## Notifications

By default, task assignees and page watchers receive notifications about tasks.

## Macros

> Macro (contentbylabel)

## Events

Tasks generate several [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).

- `taskcreated`
- `taskassigned`
- `taskcompleted`
- `taskexpired`

## App configuration

| **Setting** | **Where** | **Notes** |
| --- | --- | --- |
| **Tasks Mode** | - [Configuration - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649889951)
- [Configuration - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649956239) | Should task actions be restricted to the assignee and the creator? |
| **State's Task Behaviour** | - [Configuration - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649889951) | When transitioning to another state, should remaining tasks be copied to it or discarded? |
| **Task – Assignee** | - [Notifications - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649530054)
- [Notifications - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650119000) | Should task assignees receive notifications about their tasks? |
| **Task – Page Watchers** | - [Notifications - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649530054)
- [Notifications - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650119000) | Should page watchers receive notifications about tasks? |

## Examples

> Macro (contentbylabel)

## See also

[User Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648907144)

- [Tasks dialog box](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649824290)
- [Add Task - Page Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649890180)

[Reporting Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649070833)

- [Report on tasks](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649661358)