Reputation: 61
I'm trying to fetch all the tasks that have been completed by me, irrespective of whether they have been assigned to me. Right now I'm pulling all the tasks that are assigned to me and completed by me using - 'https://app.asana.com/api/1.0/'tasks?assignee=me&workspace=' + workspaceId +'&completed_since=' + date + '&opt_fields=completed,name,completed_at' ;
Then adding a filter to check if completed is true.
Upvotes: 0
Views: 101
Reputation: 848
Exposing a property along the lines of completed_by
on a task object is in our list of potential additions to the API.
Given the current properties exposed in the API, there is a workaround, but it is not pretty.
A Story will be generated on a task when it is completed.
Example task completion story:
{
"id": 8675309,
"created_at": "2013-01-11T00:28:25.630Z",
"type": "system",
"text": "completed this task",
"created_by": {
"id": 9531489,
"name": "Andrew Noonan"
}
}
In order to determine if you completed the task you will have to look for tasks with stories from the system with text == "completed this task"
and created_by.id == <YOUR_USER_ID>
.
Add opt_fields=this.stories.(text|created_by)
to capture those fields when querying.
Upvotes: 1