In theory, when you create a project you can pass in a set of custom_fields as $CUSTOM_FIELD_GID => $VALUE.
In practice, those custom fields aren't available on the object until after it's associated with a /portfolio/ via add_item_for_portfolio.
This means you need to:
res = create_project(...)
add_item_for_porfolio(portfolio_gid: gid, item: res.gid)
update_project(...)
This isn't inherently ruby-asanas fault, since the underlying REST API claims this should work, but it does not. Ideally, the API would take a portfolio_gid argument to create_project, which it would then associate the project to so it could create the appropriate custom_field values.
However, in much the same way that the ruby-asana library kindly handles pagination and other things for us transparently in the background, perhaps in the meantime, create_project could get a portfolio_gid, and then do this 3-step dance for the user.
In theory, when you create a project you can pass in a set of
custom_fields
as$CUSTOM_FIELD_GID => $VALUE
.In practice, those custom fields aren't available on the object until after it's associated with a /portfolio/ via
add_item_for_portfolio
.This means you need to:
This isn't inherently
ruby-asana
s fault, since the underlying REST API claims this should work, but it does not. Ideally, the API would take aportfolio_gid
argument tocreate_project
, which it would then associate the project to so it could create the appropriate custom_field values.However, in much the same way that the ruby-asana library kindly handles pagination and other things for us transparently in the background, perhaps in the meantime,
create_project
could get aportfolio_gid
, and then do this 3-step dance for the user.