Adding a task to (the top of a) section

tasks
sections

#1

I have seen in a previous API reference doc that when moving a task to a different section it was inserted at the top. However, the current behavior and doc states the opposite: “the task will be inserted at the bottom of the section”.

Is there a way to revert that or to specify the position of the task in the new section? _insert_after_and insert_before seem to only apply to lists, no boards.

Thanks!

Background: at the Done section, when the tasks are automatically moved to the bottom makes it visually harder to grasp/understand which were the latest completed tasks in a project


#2

These parameters should work equally well for a board project.


#4
  • insert_after = null puts the task at the top of the first board
  • insert_before = null puts the task at the end of the last board
  • You can’t specify section and insert_before in the same call.

It seems the only way to put it at the top of the section is first retrieving all tasks in a board and, after getting the id from the one at the top, using that id with the insert_before param. Which feels like a lot of api calls while before the API update it had the desired (and kind of expected) behaviour.


#5

This action (adding a task to the top of a section) should be possible in our API. The API route is supposed to be POST /sections/<section-id>/addTask which would take task as a required parameter and insert_before and insert_after as optional parameters. However, we never exposed this route because we were (and still are) wary about exposing endpoints that have different behaviors for the two different kinds of “sections.”

Now that we are deprecating task-sections this world becomes drastically simpler. We will eventually be exposing this route, and I’ll update this thread when it’s live in production.


#6

That makes a lot of sense. Thanks @Joe_Trollo for the clarification!


#7

Hey @Rubs, POST /sections/<section-id>/addTask is now live in production. The endpoint will take in a task as a required parameter and insert_before and insert_after as optional parameters. If one of insert_before or insert_after are not provided, the task will be inserted to the top of the section by default.

Note that since we are deprecating task-sections, this endpoint will not accept them as valid sections.


Moving a task from section to top of section
#8

Thanks @Kevin_Quicho for the update! Will test that endpoint as soon as I can.