Is it possible to update a task's people custom field value via the API?

Continuing the discussion from Introducing People Custom Field! :busts_in_silhouette::

Per the attached discussion, there appears to be a lack of documentation on updating a task’s people custom field value.

I have no problem getting a 200 response when providing an object value for a people-type custom field’s GID, yet the people-type field remains blank in the task after the supposedly successful update.

My attempts provided below:

POST /tasks
{
    "data": {
        "assignee": "1201051797275398", 
        "assignee_section": "1201684018234523",
         "completed": false, 
        "custom_fields": { 
            "1202887864833071": {"gid": ["1201051797275398"]}, 
            "1201862489770005": "https://bit.ly/3A7YuV0", 
            "1201702570970079": ""}
    }
}

also tried:

POST /tasks
{
    "data": {
        "assignee": "1201051797275398", 
        "assignee_section": "1201684018234523",
         "completed": false, 
        "custom_fields": { 
            "1202887864833071": {"people_value": ["1201051797275398"]}, 
            "1201862489770005": "https://bit.ly/3A7YuV0", 
            "1201702570970079": ""}
    }
}

finally tried:

POST /tasks
{
    "data": {
        "assignee": "1201051797275398", 
        "assignee_section": "1201684018234523",
         "completed": false, 
        "custom_fields": { 
            "1202887864833071": {"people_value": {"gid": ["1201051797275398"]}}, 
            "1201862489770005": "https://bit.ly/3A7YuV0", 
            "1201702570970079": ""}
    }
}

All attempts received a 200 response but resulted in no change to the People field (field gid = 1202887864833071 in this case).

Please let me know when there is satisfactory documentation on updating a task’s people field value. Alternatively, if someone has managed to successfully update a task’s people field value via the API, please share your secret sauce!!

Thanks :star_struck:

I concur. I’ve tried various formatting options like yours above, and while I managed to get it to go through without errors, the people field in question remains stubbornly empty.

@Phil_Seeman I don’t suppose you’ve had success populating the new People field type via API yet, have you?

I take the fifth, your honor.

(OK, so actually I have but it was enabled for me for early access. I think its not publicly enabled yet but I’m not positive; I’ve inquired with my Asana contacts but haven’t gotten an answer yet.)

2 Likes

Very helpful—thanks. We’ll be standing by! :sweat_smile:

News Flash: it should be available starting today!

3 Likes

Great news! Do you have a working example of a data package that can be used to update a ‘people’ type field?

@TomTenuta,

I think @Kothar has the syntax correct here: Introducing People Custom Field! 👥 - #40 by Kothar

As he says, it should work via an array of values, like the multi_enum field type, except that here it will be an array of user gids.