Get tasks from a project returns empty response

Hello,

I’m trying to get all tasks for a given project using GET ‘Get tasks from a project’ endpoint in NodeJS without any options Get tasks from a project but it returns an empty array of data. The call succeeds and I’m sure the project id is correct because this call works fine when I do it Postman.

Here’s the response:
{"data":[]}

I’m making that call just after the project was created a few lines before. The project creation call succeeds and returns the project id that is used to get the tasks. Could it be that the tasks are created async by Asana and not available right after project creation?

Thanks
M

Yes that’s possible. If you get them later separately using the same NodeJS code, do you get them? That would confirm your theory.

Created from a template? That’s 100% the reason why, I had the issue with a client and had to add a timeout to wait long enough…

Project duplication give you a job ID you can query though. Jobs

1 Like