Accessing Custom Field Values in a Portfolio

I am trying to access the values of custom fields in a portfolio. The program works for finding the custom field values from a project, but not for a portfolio. How can I fix this?

1 Like

Hi @Joshua_Thompson,

You didn’t say what you’ve tried thus far, but “portfolio custom fields” aren’t stored on the portfolio, they’re stored in a project. If you get a project’s data from this endpoint, it will include the custom fields and their values.

2 Likes

Hi @Phil_Seeman,

Sorry I should’ve given more background. I’m writing a program in Visual Basic for Excel. The program is supposed to pull custom field values associated with the projects in a portfolio. I was able to figure out how to get the custom field data from projects and how to do this in a portfolio. However, in this portfolio, there are both portfolios and projects stored inside of it. So, how would I be able to get the custom field data from the portfolio stored inside of another portfolio?

1 Like

Any feedback from the Asana API team would be much appreciated! If portfolios within portfolios is a new feature, maybe they don’t have an endpoint yet for portfolio custom fields?

It also appears that the native Asana export tools (CSV export and google sheet export) don’t include the portfolios stored within another portfolio

Hi @Joshua_Thompson and @Logan_Nissenson,

Maybe I’m missing something here, but again, as far as I understand it custom fields aren’t stored in a portfolio, they’re stored in the project that appear in that portfolio. Whether the portfolio is contained within another one or not shouldn’t matter, as you’re using the projects endpoint on a project within the portfolio to get the custom fields and values.

Hi @Phil_Seeman,

Thanks for the responses I appreciate the help. I’ve attached an example so we can all get on the same page. As you can see, there is a portfolio within a portfolio that has custom field values associated with it. When I use the /portfolios/{portfolio number} endpoint, the response contains the custom field settings, but not the custom field values. This is difficult because the portfolio does have custom field values, but I’m not sure how to access these values.

@Joshua_Thompson,

Ah, I see your point - for some reason, while projects return their custom_fields property by default, portfolios do not.

To get the custom fields and values for your portfolio, include opt_fields=custom_fields in your request. That should do the trick.

@Ross_Grambo @AndrewWong, any idea why this inconsistency in the API? It seems to me that GET /projects/:project_gid and GET /portfolios/:portfolio_gid should behave consisntly with each other in terms of returning the custom fields collection, no?

1 Like