I have an existing project that makes a POST request to
https://app.asana.com/api/1.0/tasks/{task_gid}/duplicate to duplicate a task, and includes subtasks, assignees, projects, notes, and tags in the “includes” list. Recently, this has stopped including the projects in the duplicated subtasks. Is this a change to the API or a bug? Is there a way I can include subtask projects when copying tasks?
Hi @Serena_G, thank you for reaching put.
To clarify, are you aiming for the subtasks to inherit the projects from the parent task or should they be multihomed in different projects? Understanding your desired outcome will help us provide more precise guidance.
It would be helpful if you could share an example of the request body you’re sending (including your include list).
Thanks @Mikhail_Melikhov. I’m looking for the duplicated tasks, including the duplicated subtasks, to have the same projects from the original tasks. Some are multihomed in different projects and some are not. For example, I have Task 1 in project A and Task 2 as a subtask of Task 1 but in project B. Project B is not being added to the duplicate of Task 2.
Original tasks:
- Task 1 - project A
- Task 2 - project B
Duplicated tasks:
- Duplicate of Task 1 - project A
- Duplicate of Task 2 - no projects
Additionally, it turns out that if Task 1 has multiple projects, then those are also not all being copied to the duplicate of Task 1:
Original Tasks:
- Task 1 - project A and project B
Duplicated tasks:
- Duplicate of Task 1 - project A
Example request body:
{
"data": {
"include": \[
"assignee",
"notes",
"projects",
"subtasks",
"tags",
"parent"
\],
"name": "Duplicate task test"
}
}
Upon further testing, I realized that project A and project B were in different teams, and the account calling the duplicate task API endpoint did not have access to the team containing project B. I invited the account to the other team, and project B is being copied in the duplicate of the parent task and the duplicate of the subtasks now.