Compact tasks not returned in priority order

I am using the JS client library to write some command line utilities.

I have a Kanban board with 5 columns. When I retrieve the tasks for that project they are not returned in priority order, i.e. they do not match the order as presented in the Asana UI. Can someone help me understand why this might be the case?

Specifically, I’m using the following:

const getCompactTasksForProject = async (projectId) => {
	const compactTasksForProjectResponse = await client.projects.tasks(projectId);
	return compactTasksForProjectResponse.data;
}

Thanks,
Luke

Is the order by any chance the order of creation? I think I had the same bug, the order given was the order of creation. My solution was to first duplicate the project and then export the duplicated one.

Thank you for you reply; you’re right, they are in order of creation.

Can you please expand a little on your workaround solution? By duplicate, do you mean within the Asana UI? If so, I don’t think this is going to be a feasible solution for our workflow.

In my case it was in the Asana UI yes. @Matt_Bramlage is this a bug or a desired behavior?

Thanks for your help @Bastien_Siebman. Hoping @Matt_Bramlage can help… as it stands, I don’t think I can pull a prioritized list of tasks from Asana via the available APIs.

This behavior is unintentional in board-view projects, but will be fixed soon as part of our sections data model work. In particular, from that post:

If you list all the tasks in a board-view project, they’ll be returned in an order based on when they were inserted into the project (with most recently inserted tasks first). After the migration, they’ll be in the intuitive order: First top-to-bottom in a column, then left-to-right by column.

In the meantime, if you first fetch all the columns in a board-view project with GET /projects/<project-id>/sections and then fetch the tasks section-by-section with GET /sections/<section-id>/tasks you’ll be able to see the tasks in the correct order within each column.

2 Likes

Thanks for your help @Joe_Trollo - solved my issue!