Asana / ruby-asana

Official Ruby client library for the Asana API v1
MIT License
77 stars 54 forks source link

cannot retrieve Portfolio custom fields #103

Open Duartemartins opened 3 years ago

Duartemartins commented 3 years ago

If I make the following query: client.portfolios.get_portfolio(portfolio_gid: portfolio_gid, options: { pretty: true }).custom_field_settings

I get:

NoMethodError: undefined method 'new' for #<Asana::Resources::Portfolio:HexString> The same thing happens when I try to use the .get_items method

Documentation referenced here: https://www.rubydoc.info/github/Asana/ruby-asana/Asana/Resources/Portfolio

ghost commented 3 years ago

@Duartemartins I met it today. After debugging into the codebase, I found this line causes the error https://github.com/Asana/ruby-asana/blob/e53547ab0ff79580dd39b54705c0d30b6d52f079/lib/asana/resources/portfolio.rb#L168 where type must be CustomFieldSetting rather than self