How to extract project names for subtasks

Hi! I’m fetching data on user tasks from their ‘My Tasks’ page. While the web app’s task table displays project names for subtasks within a project, the JSON data does not include project names for these subtasks. Is there a straightforward way to retrieve the project names for nested subtasks, or do you need to extract them by referencing parent tasks via additional requests?

Thank you!

Hi @Elena_Maeva,

The UI in My Tasks was recently updated to display the project name for subtasks but this is just a UI presentational element only; that property doesn’t exist in the underlying data store, and since the Asana API functions at the data store level, you won’t find it in your API data.

Bottom line: yes, you’ll need to reference the parent task which is actually attached to the project at the data store level.

One caveat: it is possible to actually attach a subtask to a project, and if you do, then you WILL get the project data returned within the API for that subtask object.

(Fun fact: the “Projects” column in My Tasks does not visually differentiate between a subtask which is actually attached to a project and one which is not but is just visually presenting the project in that column. When they first added this recent feature, some of us tried to argue for a visual distinction between those two different states, but we were not ultimately successful. They actually did have a visual distinction in an early beta, but they removed it when the feature was released. :cry:)

3 Likes

Hi Phil,
I got it, thank you very much for such detailed explanation!

1 Like