My Tasks: fetching custom sections

I’m able to use the /user_task_lists/…/tasks endpoint to fetch the My Tasks equivalent list. I can also opt-in to receiving the legacy section via assignee_status. However, I can’t figure out how to fetch custom section info for these tasks. All the section API info is centered around project relationships for sections – how do I, for example, fetch a list of sections for user (i.e. custom sections that would show in their My Tasks view)?

Hi @Ian_Gulliver and welcome to the forum!

To get the sections in a My Tasks view, just use the regular Sections endpoints.

However, note that you can only retrieve this info for your own My Tasks view (that is, for whatever user’s Asana account you authenticate to). This is not an API limitation but the general Asana permissions design: the organization of one’s My Tasks is designed to be private to only that user.

Just to be clear, there’s nothing “legacy” about that section; that is the current section.

The only list sections endpoint that I see is GET /projects/{project_gid}/sections, which requires a project. I can look up individual sections by section_gid, but I don’t have that. How can I list section GIDs and names inside My Tasks?

Yeah, the API documentation is not very clear here.

In Asana technical and API terms, the My Tasks view is a user_task_list (UTL). A UTL acts like a regular project in many ways.

If you pass the gid of your UTL to the GET /projects/{project_gid}/sections endpoint as the project_gid, you’ll get the list of all of the sections in your UTL that you’re looking for.

How do you obtain the gid of your UTL? Use this endpoint: GET /users/{user_gid}/user_task_list

Confirmed that works, thanks! If anyone who can update the documentation encounters this, please fix it – this is incredibly non-obvious.

1 Like