Dependencies not returned in API call

Briefly describe (1-2 sentences) the Bug you’re experiencing:
When using the Asana API (e.g. /tasks/<task_id>) and selecting “dependencies” and/or “dependents” under the opt_fields parameter I’ve came across a set of tasks that don’t return any dependencies/dependents BUT which do return those fields when calling the corresponding dedicated APIs (/tasks/<task_id>/dependencies and /tasks/<task_id>/dependents).

The incorrect behavior only happens in a subset of the tasks being iterated.

Steps to reproduce:

  1. access the Tasks API:

  2. access the Task Dependents API:

(Note: scrubbed the task names)

  1. the first API call has an empty dependents array () while the second one has 4 entries.
    These relationship between the tasks can be seen in the Web UI when browsing the dependents,(e.g. <ASANA.COM>/0/1122540251010028/1123568154469458).

Browser version: N/A

Upload screenshots below:

(can only share 1 screenshot since I’m a new user here… when accessing this link in the browser the 4 dependents entries are visible)

Hi @Davide_Marques and welcome to the forum,

Hmmm, personally I haven’t run across that before.

I don’t think it should make a difference but just to see, try using opt_expand instead:


Do you get any dependent return data?

cc: @Joe_Trollo

1 Like

Hi @Phil_Seeman! Thanks for your quick reply.

I had also explored that approach. It also returns an empty dependents array:

I wonder if it could be a permissions issue? Are you sure you (i.e. the user account you’ve authenticated to) have access to those dependent tasks?

I can see all tasks in the Web UI so that’s not the case.
If it was a permissions issue then the calls to /tasks/<task_id>/dependencies or /tasks/<task_id>/dependents should also not return any results.

It seems to be a bug in the logic that fetches the dependencies via opt_fields (not sure what’s different in those specific tasks but the results across the 2 APIs should be coherent).

Good point.


I do know that I use the /tasks/<task_id>/dependencies and /tasks/<task_id>/dependents endpoints to get my dependency info for Flowsana, not the /tasks/<id>?opt_fields=dependents endpoint. I do that because historically there was an issue with the latter endpoint incorrectly returning dependencies that had since been deleted (that was due to an internal Asana index caching issue) whereas the former endpoints were always accurate. That issue (which is sort of the opposite of yours - I was getting dependencies I shouldn’t have, you’re not getting ones you should) has since been fixed, but perhaps there’s still some related index-caching issue that’s biting you now.

@Joe_Trollo, any ideas?

I talked to one of our API engineers about it and he’ll look into it. It sounds like they might know whats going on. :slight_smile:

1 Like

Nice! Thanks @Ross_Grambo!

Hi @Ross_Grambo! Any news from the team?

I’m using the dedicated APIs as a fallback in the cases where of the initial call doesn’t return any dependency or dependents. While it works… it’s wasted time / API calls that could be saved.

1 Like

Nothing yet. I think they were wrong about their hunch of what the issue was.

I’ll keep bugging them. Feel free to keep pinging me here as well. :slight_smile: I’ll comment here when progress is made.

Hello everyone!

Long time to circle back to this, but our API team was able to identify the issue and resolve it!

Let me know if you still have any issues with this.

I managed to get dependents.gid for task but is not working. Is that true that dependents field on tasks is force-compact and to retrieve dependent tasks details I do have to issue extra GET /tasks/{task_gid} requests?

I should probably make the docs more clear, but yes, currently you’re limited to gid and resource_type on the dependents object. Looks like the API team did this to stop infinite expansion like opt_fields=dependents.dependents.dependents…