Unable to use status_updates functions
Johns-b opened this issue · 1 comments
Johns-b commented
**Issue : **
Client throws ''Client' object has no attribute 'status_updates'' error when accessing any functions in 'status_updates' object.
Client Version :
0.10.9
Note: Was using the pip to install asana, but noticed that 'status_updates' was only available in the latest version of the client. Hence, pulled from the repo, but still getting the same error.
jv-asana commented
Hi @Johns-b,
This is a bug and is fixed in our latest version v2.0.0. Here are some sample requests:
import os
import asana
from pprint import pprint
client = asana.Client.access_token(os.environ['ASANA_PERSONAL_ACCESS_TOKEN'])
# GET /status_updates/{status_gid}
# https://developers.asana.com/docs/get-a-status-update
result = client.status_updates.get_status('<YOUR_STATUS_GID>')
pprint(result)
# DELETE /status_updates/{status_gid}
# https://developers.asana.com/docs/delete-a-status-update
result = client.status_updates.delete_status('<YOUR_STATUS_GID>')
pprint(result)
# GET /status_updates
# https://developers.asana.com/docs/get-status-updates-from-an-object
result = client.status_updates.get_statuses_for_object({'parent': '<YOUR_PARENT_GID>'})
pprint(list(result))
# POST /status_updates
# https://developers.asana.com/docs/create-a-status-update
result = client.status_updates.create_status_for_object({
'html_text': '<body>The project <strong>is</strong> moving forward according to plan...</body>',
'parent': '<YOUR_PARENT_GID>',
"status_type": "on_track",
"title": "Status Update"
})
pprint(result)