How to get user roles for a project using the Asana API

Hello,

I am trying to use the Asana Python API library to get the project roles that appear on the Overview page when accessing a Project. I’m new to the Asana API and I couldn’t find anything related to this in the documentation or in the community forum.

Any help would be greatly appreciated, thank you!

1 Like

Hi @Rares_Lungu and welcome to the forum!

The role field is undocumented in the API docs (cc: @AndrewWong, maybe you can add it?) but you can access it using the opt_fields option; see:

Note that it’s a property of a user’s workspace membership, not of a specific project, so you won’t be able to get it via a project-related call.

2 Likes

Hello @Phil_Seeman and thank you very much for the prompt reply.

I’ve followed your answered and tested it for my situation but unfortunately, it is not the same thing as what I was looking for.

For my use case, I’d like to get the project roles of all the project members, which are assigned at the project level (and which could technically be different from project to project within a workspace) rather than the roles set at the workspace level (which are unique for each workspace).

Do you know of any method call or endpoint that would return this information?

Thank you!

answer, sorry :blush:

Oh sorry, I missed that.

I’m sure that’s on the project_membership object but I don’t know of any way to get that (I just tried some ideas but came up empty).

@AndrewWong or @Ross_Grambo do you know of any way to get at that undocumented “project role” field via the API?

1 Like

Sorry, project roles aren’t exposed anywhere in the API yet :frowning:

3 Likes

That’s unfortunate but thank you very much for your reply!

Hi,

I just ran into this same issue. We have a script to keep Asana in sync with our other apps, and it would be a nice touch if the script could get/set user project roles.

Has this field been exposed through the API?

No, they haven’t exposed it as of this writing.

1 Like