API to get custom field value from a task

I’m testing the ‘tasks’ API to return all details for a specific task by Task ID, and while my custom field values get returned within the response, I’m having a difficult time parsing out a specific custom field value. Is there any easy way to do this, or another API to use that would get a specific custom field value, either based on the name the of the field or the gid?

Thanks in advance,
Chris

Hi,

The API will return the task full record including custom fields with values, options etc (as long as you have the right opt_fields) and then you need to do the filtering on the client/server side, by extracting the field you are looking for. In my case for example in nodeJS I do something like task.custom_fields.find(f => f.gid === this.fieldIAmLookingForGid)

Does this help?

1 Like