I’m sure I’m probably just missing something simple, but for the life of me I can’t update a custom field on a task. Here are the various snippets I’ve tried:
For each of the above, I’ve tried with and without quotes around: data, custom_fields, and my_custom_field_id
Note: I’m using the actual numbers, not variable names, until I get it working.
Note: I was initially attempting to update a custom date field, but I also can’t even update a custom text field.
Note: I’ve been getting custom field data from tasks for years now without issue. This is the first I’m trying to update custom fields.
I assume the button performs the operation in a standard way, and not the language selected (which makes sense). But looking at the header details, I don’t see how my code isn’t doing the same thing.
From my understand it looks like you are trying to update a custom field value on a task through our Update a task endpoint. Here’s how you would do this with our node-asana v1.0.2 client library:
I think the difference here is no need for the quotes for “custom_fields” key. Your last request also has a space in between the client and tasks → client. tasks → should be client.tasks
Oddly, I can update the field through the API documentation Try It for Node – but the code shown doesn’t change with the inputs in the documentation.
Our documentation site does not support trying our client libraries through it so when you make changes to the field inputs/text inputs in our docs it will not change in the sample code editor to the right. This will only work for shell and other samples like Axios, Node-fetch etc…