How do I move a Task from one Section to Another via the API? I see there is an insert_after or insert_before parameter - can this be used during an update?
Asked
Active
Viewed 815 times
1 Answers
0
If you do use the ID of the section's task for insert_after
parameter to POST /tasks/:id/addProjects' it will move the task to be directly after the section. Alternatively, you could do an
insert_before` of the following section, which would put it at the end.
We have some changes to better support sections in the API coming in the future, but for now this is the best workaround.

agnoster
- 3,744
- 2
- 21
- 29
-
Does this ONLY work for addProject endpoint? I can't use this parameter for the tasks endpoint? – M.R. Sep 05 '14 at 19:57
-
Correct, it only works for addProject - this is because position only makes sense in the context of a project (you can have tasks positioned differently in different projects), but it's conceivable that at some point you could embed a project *and* the position on the PUT endpoint, but we have no plans to do that right now since it seems like it would just complicate things. Do you have a particular use case in mind where this would be helpful? – agnoster Sep 07 '14 at 23:22
-
Yes - we are trying to build an sync integration between quickbase and asana, and one thing that we are missing in asana is status. Sections are the defacto status in asana, but they are not really a part of the task (as far as I can see) - it is inferred based on the position of the task in the project. WE made sections in asana to match the status in QB. But via the API, the only way to know the status is to traverse up the list of tasks. – M.R. Sep 08 '14 at 05:37
-
So now when we add a task via QB into asana, we would like to add it in the section where it matches the qb status. Right now I am having to add the task first. While adding the task, I am already adding the project, so I thought making another HTTP call was a little bit wasteful. Since we can add a project during the addtask function, I thought just adding insert_after in that same call would make sense. I understand the problem though - you could technically add a task to multiple projects at the same time, so then what ID of insert_after would you provide? – M.R. Sep 08 '14 at 05:37
-
So I guess what you'd ideally want is something like `POST /tasks { name: "...", projects: [ { id: 12345, section: 34567 } ], ... }` so that you can add a project *and* the section at the same time during task creation, right? I think we may end up supporting that, but it's not yet on the roadmap. I'll make sure we've captured this in our internal task list though. Thanks! – agnoster Sep 08 '14 at 13:58