- I have a project ID
- I have successfully retrieved the data about the project from the API (https://app.asana.com/api/1.0/projects/{MyID})
- In the response of this API, I want a list of all the related portfolios, so that I can get information about the portfolio owners.
- Based on my observations, the API does not show information about related portfolios
My question is, how can I retrieve the related portfolios for my project? In the end, I want to know who are the owners of those related portfolios, and display information from their profiles.
Hi @Saahir_Foux and welcome to the forum,
Iâm not aware of any way to directly retrieve a list of the portfolios that a given project is contained in.
@Bastien_Siebman do you know of any way to get that in the API?
Iâm also checking with the Asana API team.
1 Like
Indeed for me it is the other way around, you need to query for portfolios to see what projects they contain.
Sadly, that is the approach my team also suggested. Itâs inefficient, but that appears to also be the only way until the Asana Team releases an update to resolve this.
My tries:
me = asana.Client.access_token([âPERSONAL_ACCESS_TOKENâ]).users.me()
portfolios=asana_client.portfolios.get_portfolios({âworkspaceâ:int(me[âworkspacesâ][0][âgidâ]),âownerâ:int(me[âgidâ])}, opt_pretty=True)
Only problem is if I am not the owner, I wont get dataâŠ
We would hope/want this for work for a reader, as a reader can see related portfolios per project in UI, isnt it.
Like @Bastien_Siebman said I would want to populate portfolios and projects list and then group concat for getting portfolios per project.
But is there a workaround for getting things without one being owner of projects.
I believe your problem lies with this sentence in the doc, within the âget multiple portfoliosâ section:
Returns a list of the portfolios in compact representation that are owned by the current API user
Apparently you canât list all portfolios you can see in the UI, but only the ones you own UNLESS you have the portfolios id already I suppose and you can get them one by one.
1 Like
Is there any way around this yet? Itâs surely a common need to list portfolios that you arenât an owner of, or if you donât know the owner ID.