# Subtask Inherit Assignee

> **Note: Availability**
> This workflow uses functionality that is only available using the JavaScript Editor. This means that it is unavailable for editing in the Workflow Constructor.
>
>
>
> To learn more about this workflow, refer to the corresponding page in our [Developer Portal](https://www.jetbrains.com.cn/en-us/help/youtrack/devportal/Workflow-Subtask-Inherit-Assignee.html).

This workflow automatically sets the assignee of a subtask to the user who is assigned to work on the parent task.

| Name | @jetbrains/youtrack-workflow-subtask-inherit-assignee |
| Auto-attached | no |
| Rules |      * Assign subtask to assignee of parent issue (on-change)    * Update assignee for subtask when parent issue is reassigned (on-change)    |

## Use Case

This workflow helps you manage the assignment of tasks and subtasks.

For example, when a parent task is assigned to Alice, a newly linked subtask inherits Alice as its assignee. If the parent task is later reassigned to Bob, the workflow updates subtasks that are still assigned to Alice and leaves subtasks with a different assignee unchanged.

## Rules

This workflow includes two rules.

| Title | Description |
| --- | --- |
| Assign subtask to assignee of parent issue |         This rule checks a subtask when it is linked to a parent task. If the subtask is not assigned, the issue is assigned to the assignee of the parent task.     |
| Update assignee for subtask when parent issue is reassigned | The next rule checks for subtasks when an issue is assigned to another user.       * If the subtasks are in an active project and still assigned to the previous assignee of the parent task, the assignee for each subtask is set to the current assignee of the parent task.    * If the subtasks are in an archived project, they are ignored.   |

