Can't insert an enum option as the first option: get custom_field_enum_option_not_existing when putting first entry's gid as insert_before

I am struggling to use the api to insert an enum option as the first option in an existing custom field. When I try to do so, passing in the gid of the first (index:0) existing enum option, I get the error, custom_field_enum_option_not_existing and it tells me that gid is invalid.

When I pass in the second gid (index:1) as my insert_before value, the api call runs just fine.

I recorded this loom (not sure if that’s allowed here) demonstrating the issue: Loom | Free Screen & Video Recording Software | Loom

Anyone get past this issue? Any ideas? Anyone from Asana able to validate if this is a known bug?

Hi @Steve_Robinson,

Inserting before the first item does work, and I think the source of your issue is not a bug, although one could certainly argue it’s not intuitively obvious: I think the issue is that your first item is not an active enum option, meaning, as per the docs:

Setting enabled=false is equivalent to “trashing” the enum option in the Asana web app

2 Likes

@Phil_Seeman you nailed it! Thank you!

I’d have spun my wheels on this for a long time without your help. The docs give zero indication this might be true. There’s no mention of enabled needing to be true on the description of insert_before and insert_after.

The error message received contains no clues and the fact that enabled=false enum items maintain their order makes this even more counterintuitive.

Thank you for your help. I really appreciate it.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.