node.jsasana

Asana: update custom field value with Node


I'm trying to change the value of a custom task using the Asana package for NodeJS. Sadly the official developer documentation appears to be out of date, because the updateCustomField method in the example is not valid anymore.

It looks like custom_fields can now be passed to the task.update method, but I run into 'Invalid request errors' when trying this.

Thanks!


Solution

  • It is indeed part of the task.update method. In the data for this method, you can set the custom_fields property to an object, where the key is the GID for the custom field you want to change and the value is the value you want to change to.

    Which looks something like this:

    client.tasks.update(taskID, {
        custom_fields: {
          "1234": "New value for field"
        },
        name
      })