0

I written code so far:

$projectId = 'XXXXXXXXXXX';
$tasks = $asana->getCompletedTasks($projectId);    

Function call

public function getCompletedTasks($projectId){                                            
  return $this->askAsana($this->projectsUrl."/{$projectId}/tasks?completed=true");
}

But it gets all completed & incomplete tasks. I want to fetch only completed tasks. Anyone have idea?

Chiku
  • 107
  • 11

1 Answers1

0

Here is the list of valid query parameters for tasks. Unfortunately, completed is not currently supported.

You can use completed_since=now to retrieve only incomplete tasks. However, there is no server side method for retrieving only completed tasks.

The best way to accomplish this would be to get all tasks for the project, using pagination to ensure efficient and full coverage. Then perform client-side filtering on the completed field of each task.

Remember that query results are returned in compact form (id & name) and you should use field selectors to have additional fields such as completed included in the payload.

Andrew Noonan
  • 848
  • 6
  • 13