Unable to update task description when using task template

I’m trying to update the task description when instantiating a task with a task template, but it doesn’t seem to work. I am now thinking that I need to update the task directly with it’s gid.

Pointing me in the right direction would be appreciated:

def dup_template():
    url = f"https://app.asana.com/api/1.0/task_templates/{TASK_TEMPLATE_ID}/instantiateTask"

    headers = {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": f"Bearer {AUTHORIZATION_CODE}"
    }

    data = {
    "data": {
    "template": {'name': "Sample",
                 "description": "LINK",
                 "html_description": ",<body><strong>LINK</strong></body>"
                 }

    }
    }


    response = requests.post(url, headers=headers, json=data)

    print(response.json())

dup_template()

Hi @Omeed_Kianizadeh ,

I don’t believe that’s currently supported (I looked at this documentation, which shows name as the only field supported in the body). I think you’d need to call that endpoint to create the task, grab the task_gid from the returned object, and pass it to this endpoint where you can update the description.

1 Like

@Stephen_Li I figured. Thanks for the quick response, i’ll continue along that path then.

1 Like

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