Get portfolio items missing owner name

I am successfully fetching portfolio items through the asana python client as such:
self.asana.portfolios.get_items_for_portfolio(portfolio_id, opt_fields=[“name”, “owner”])

This correctly returns the fields I need but in the owner section there is only the gid and the resource type. The documentation Portfolios says that I should also be getting the name as part of the owner section.

I am able to get fetch this extra information by looping through the items and calling get_user for each gid but this adds significant latency and I need this name or email to find the corresponding slack user

Is there a way to solve this issue?

Thanks

Hi @Vincent_Fronterotta and welcome to the forum,

I haven’t tried this on a portfolio object but try asking for owner.name in opt_fields:

self.asana.portfolios.get_items_for_portfolio(portfolio_id, opt_fields=[“name”, “owner.name”])

1 Like

Hi @Phil_Seeman

This solved it! Thanks a bunch, good to know that I can specify nested fields like that

2 Likes

This topic was automatically closed after 6 days. New replies are no longer allowed.