Creating a section

I would also like to add sections programmatically from Python using the Asana API.

Found this in another forum thread:
… (And for the technically-minded, from a development/API perspective, subtask sections are called separators to distinguish them from true sections.)

Hi @EzRyder,

FYI I moved your posts to the API forum section.

Do you mean top-level sections within a project, or (as I suspect from your reference) subsections; that is, sections or separators within a task’s subtasks?

Thanks Phil!
Correct, I’ve figured out how to create/manage the top-level sections within a project using Asana’s Python library. Programmatically, I’m looking to 1) create sections/separators within a task’s subtasks, and ideally 2) move/assign subtasks to a section/separator.
The section/separator is very useful to organize subtasks and I use it extensively, but it’s a bit of a PITA doing it manually so I’d like to automate if possible. Cheers!

Background
I use Asana projects to group related top-level tasks which are essentially individual projects. These top-level tasks/projects are active across months/years, with many subtasks assigned to each along the way. Asana is great for referencing these subtasks using @ references in multiple places…meeting notes, chat records, task notes, etc, and it would a big time saver to be able to automate assigning these subtasks into the appropriate task/project upon creation.
For example, I use several top-level tasks/projects which I duplicate for new calls, meetings, projects, chats, and project-specific tasks.

It’s actually pretty simple: just programmatically create a subtask and set its is_rendered_as_separator property to true.

Since a subsection/separator is really just an Asana subtask (with that above property set), you can’t assign other subtasks to it like you can with top-level sections; all you can do is move/order/rearrange subtasks (including separators) within a list of subtasks. Doing that is a bit less obvious; you use the setParent endpoint to do it, using an insert_before or insert_after parameter:

I’m looking at the API reference for create subtask for task, and is_rendered_as_separator appears only in the response, not in the body[data] parameters for creation.
Am I missing something?

The doc is really incomplete there. When creating a subtask, it’s just a task object that has its parent property set, and any property that’s available on a task object can be set for a subtask.

1 Like

Success!!! I went ahead and tried it and…it works!
Thanks so much for the additional information. I hadn’t noticed the is_rendered_as_separator field until you pointed it out.
I very much appreciate your help Phil!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.