Tasks endpoint doesn't return tasks assigned to multiple projects

Hello,
I’ve been using the API for a long time to show completed tasks on my customer’s dashboards.

I use this endpoint:
https://app.asana.com/api/1.0/projects/XXXXXXXX/tasks?opt_fields=name,completed,completed_at,html_notes&limit=20

I’ve recently noticed that tasks that are assigned to multiple projects are not returned by this endpoint, even though they appear as completed in each one of the projects that they were assigned to when using the web interface.

Is this a bug or a feature, or am I doing something wrong?

TIA

Hi @Julian_Del_Campo , welcome to the forum!

I just tried it in our app.

Set a task to more than 1 project.
Complete the task.

Query tasks for one of the multiple project membership.

And, I get the correct response, with completed true and false.

sample:

GET /api/1.1/projects/269136150323740/tasks?opt_fields=id,modified_at,completed,completed_at,memberships.project.gid

{
	"data": [{
			"gid": "1202111908017998",
			"completed": true,
			"completed_at": "2023-07-04T17:36:40.264Z",
			"memberships": [{
					"project": {
						"gid": "269136150323740"
					}
				}, {
					"project": {
						"gid": "269451171754166"
					}
				}
			],
			"modified_at": "2023-07-04T17:36:40.362Z"
		}, {
			"gid": "1203940979226123",
			"completed": false,
			"completed_at": null,
			"memberships": [{
					"project": {
						"gid": "269136150323740"
					}
				}
			],
			"modified_at": "2023-06-27T14:32:44.924Z"
		}, 
		...

One difference: in my url, I use “1.1” instead of “1.0”, I don’t know if that changes something!
I haven’t tried.

1 Like

Thanks for your reply!
I now have some more information on how to reproduce the issue:

1 - Create a task, and assign it to project A and project B.
2 - Mark the task done on project A (this automatically marks it done on project B).
3 - Request tasks via the API for project B. The recently completed task is not in the response for project B, but it is in the response for project A.

I hope this helps clarify the situation.

1 Like