Sorting results for tasks.xml does not appear to work

12 views
Skip to first unread message

Michael

unread,
Oct 24, 2016, 7:20:20 PM10/24/16
to Assembla API Development
Hi,

I am trying to run a query to find the most recently updated tasks (http://api-doc.assembla.com/content/ref/tasks_index.html) and am passing through the following query parameters:

$query['per_page'] = 1;
$query['page'] = 1;
// Already tried:
// $query['sort_by'] = 'updated-at';
// $query['sort_by'] => 'ticket_number',
// $query['sort_by'] => 'hours',
// $query['sort_by'] => 'end_at',
$query['sort_by'] = 'updated_at';
$query['sort_order'] = 'desc';

//actual URL: https://api.assembla.com/v1/tasks.xml?sort_by=updated_at&spaces=<space>&from=2016-10-01&to=2016-11-01&per_page=1&page=1

I was receiving mixed results and therefore I used a larger per_page count and have seen the following results using sort by updated_at:

created at                   - Updated at
2016-02-01T08:27:29Z - 2016-02-01T08:27:29Z
2016-02-01T08:26:44Z - 2016-02-01T08:26:44Z
2016-02-01T08:18:12Z - 2016-02-01T08:18:12Z
2016-02-01T07:42:04Z - 2016-02-01T07:42:04Z <-
2016-02-01T07:13:02Z - 2016-02-01T07:42:57Z <-
2016-02-01T07:08:29Z - 2016-02-01T07:08:29Z
...
2016-02-01T06:34:15Z - 2016-02-01T06:34:15Z
2016-02-01T06:33:21Z - 2016-02-01T06:33:21Z <-
2016-02-01T06:32:20Z - 2016-02-01T07:42:49Z <-
2016-02-01T06:27:31Z - 2016-02-01T06:27:31Z
...
2016-01-29T05:46:53Z - 2016-01-29T05:46:53Z
2016-01-29T05:24:48Z - 2016-01-29T05:24:48Z <-
2016-01-29T05:23:02Z - 2016-01-29T05:50:07Z <-
2016-01-29T05:23:02Z - 2016-01-29T05:23:02Z
2016-01-29T05:23:02Z - 2016-01-29T05:23:02Z
2016-01-29T05:23:02Z - 2016-01-29T05:23:02Z

As you can see from the above there are several entries that are not sorted by updated-at but in fact are sorted by created-at. Is it possible to sort on the updated-at field?

I have also tried to sort by other fields: eg. ticket_number, hours, etc. None of which changed the sort order.

Any help you can provide will be much appreciated.

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages