Unparalleled assignee stracture

HI, is it ok that the assignee object doesn’t have the same structure always?

Screen Shot 2022-09-21 at 12.00.50 AM

1 Like

I can see this, too. When you get a list of tasks with assignees, some assignee objects have all properties (name, email, photo) and some have just gid and resource_type. Is this a bug in the API?

No it is kinda expected: you need to use the field opt_fields to ask for the fields you want. What Asana gives you by default might vary, make sure to specify what you need!

Basically I specify assignee as a field that I want to have inside the tasks and subtasks objects.
Same opt_fields parameters work different depending on the request.

For tasks I get the full object, but for the subtasks I get only the id of assignee.

Asana returns different default fields depending on request and objects indeed. If you want specific fields for embedded objects you’ll have to go as deep as needed in opt_fields (for example « custom_fields.name » on tasks)

I hope this helps!