I am toying with your lovely API, in particular to retrieve a list of the uncompleted tasks assigned to a user. My goal is to create a simple page from which I can print someone’s “Today” or “Upcoming” tasks without many frills.
Now, for me it easy to get to the user’s tasks, with
GET /tasks
which in php returns the compact task record.
My issue is that to limit the tasks to the “todays” and “upcomings” I have to get the full list, then read task by task to limit my list exclusively to the groups I need. I have to do this as the GET /tasks does not allow me to specify the assignee_status nor the compact record contains it.
Is there a way to use assignee_status to shortlist the list of tasks I need to query?
With our php client library that ends up looking something like the following example:
<?php
require dirname(__FILE__) . '/vendor/autoload.php'; // This is using Composer for dependencies
use Asana\Client;
$ASANA_PERSONAL_ACCESS_TOKEN = getenv('ASANA_PERSONAL_ACCESS_TOKEN'); // Get my access token from the shell environment
$client = Asana\Client::accessToken($ASANA_PERSONAL_ACCESS_TOKEN);
$taskIterator = $client->tasks->findAll(array('workspace'=>getenv('ASANA_WORKSPACE_ID'), 'assignee'=>'me'),
array('fields'=>array('name', 'assignee_status'), 'item_limit'=>10)
);
foreach ($taskIterator as $index => $task) {
var_dump($task);
}