---
title: "complete-task macro"
canonical: "https://support.appfire.com/space/CDML/650251348/complete-task%20macro"
format: markdown
---
> Macro (aura-html)


> Macro (toc)

## Overview

> Macro (excerpt)
> 
> Mark a task as complete

The `complete-task` macro is used to mark a task as completed.

## Where to use it?

Optional.

One or more `complete-task` macros can be put in a [trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133).

## Parameters

| **Parameter** | **Required** | **Default** | **Notes** | **Ver** |
| --- | --- | --- | --- | --- |
| `task` | :check_mark: |  | Name of the task to complete.<br>> ℹ️ No action is taken if the task does not exist or is already closed. | 3.2.2 |
| `comment` |  |  | The comment recorded against the completed task. | 3.2.2 |

## Events

The following [events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) are associated with task completion:

- `taskcompleted`

## Example

```plaintext
{workflow:name=Task completion}
   {state:Test|taskcompleted=Completed}
      {task:Add an attachment}
   {state}
   {state:Completed}
   {state}
   {trigger:attachmentadded}
      {complete-task:task=Add an attachment|comment=An attachment was added}
   {trigger}
{workflow}
```

  
The workflow events and activity history associate the completion of the task and any associated task-completed transition with the current user who added the attachment.

![image](media://3edafa3c-9a55-4aef-809a-b42dfa9daa2b)

## See also

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

- [Tasks](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694408)
- [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)

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

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

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

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