I am trying to run this follow update to a task and am getting back a 200, but nothing is changing in the task
import requests
ACCESS_TOKEN = os.environ.get("ASANA_ACCESS_TOKEN")
API_URL = "https://app.asana.com/api/1.0"
headers = {"Authorization": f"Bearer {ACCESS_TOKEN}"}
input_data = {
"analysis_status_gid" : "1202041658681489",
"task_id" : "1202841729603456"
}
url = f"{API_URL}/tasks/{input_data['task_id']}"
body = {
"data": {
"custom_fields" : {
input_data['analysis_status_gid']:"1202331527650063"
}
}
}
r = requests.put(url, headers = headers, data = body)
response = r.json()['data']
if i run the same call through the asana library it does update my custom field value
import asana
client = asana.Client.access_token(os.environ.get("ASANA_ACCESS_TOKEN"))
input_data = {"analysis_status_gid": "1202041658681489","task_id":"1202841729603456"}
body = {
"custom_fields": {
input_data['analysis_status_gid']: "1202331527650063"
}
}
result = client.tasks.update_task(input_data['task_id'], body, opt_pretty=True)
what am I doing wrong?