In the tasks app you're able to assign tags to tasks so that when a task is completed, the ticket is given that tag. By adding a tag to the ticket, this taps into the power of Zendesk triggers, allowing you to spin off any workflow you like as a result of the task being completed.
Here's a video explaining how it works:
To attach tags to tasks, in the main tasks screen, under the "Task Lists" tab, click on the desired task list like this:
Here you will see there's a couple of columns that are listed alongside each task. One of those columns is "Tag".
To define the tag that gets added when the task is completed, simply click the edit next to the task. Then in the modal, set the tag you want and at the bottom click on 'update task' like this: