Asana Custom Field - People

I am trying to pass in a people_value object to a custom field. However the field is not populated when I try to pass in the people_value object. I feel like I have something slightly off or wrong on the syntax. Any help is appreciated!


    result = asana_client.tasks.create_in_workspace(WORKSPACE_ID,
                                              {'name': name,
                                               'notes': notes,
                                               'projects': [PROJECT_ID],
                                              'custom_fields': {'1202935116953164': {"people_value" {"gid":"1200671314992247"}},
                                                                }})
1 Like

I believe the issue is that when passing a value for a custom_fields, you can assume the format and only pass the gid, no need to add people_value.

Try this:

'custom_fields': {'1202935116953164': "1200671314992247"},

Thanks for responding @Bastien_Siebman, however that raises the following error. I can’t quite figure out the right valid format of the object to send.

asana.error.InvalidRequestError: Invalid Request: people_value: Value is not an object

I must be wrong then I’ll re read the doc and get back to you

I’m also struggling with this!

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 don’t see people_value on the docs maybe this is not supported yet! @Phil_Seeman ?

I believe support for it has not yet been added to the public API; I’m checking on this and will report back!

@Phil_Seeman any chance you were able to check in on this?

Hey @Tim_Faraci, I’ve got this working with the following data example:

{

“data”: {

"custom_fields": {

    "{{fieldGid}}" : [

        "{{userGid}}"

        ]

    }

}

}

4 Likes

Yes, it’s now been released to all.

Thanks for that example, @TomTenuta!

1 Like

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