Api/deployments no longer sorted from most recent to least recent deployment

I am using the /api/deployments?taskState=Success end point to get the deployments for the month from the server, but when I upgraded to 3.5.2, the order is now incorrect, so I have to parse the whole list to get the result.

Is this a feature change?

Hi Andrew,

Thanks for getting in touch. I’ve checked the 3.5.2 code and we do not order the records within each page of results. However the pages themselves should be ordered by created date descending. Is this what you are seeing? If so you should be able to stop paging once you get a record outside your date range.

Due to the side effect of another change, this issue will be fixed in 3.5.3.

As an aside, you can add a “take=1000” parameter to increase the page size.

Regards,

Robert W

Hi Robert,
I am seeing that not even the pages are in order.
I.e. My page 1 results were all before the page 4 results.
ThanksAndrew

Hi Andrew,

Thanks for getting back to me. Would you be able to send me an example of the output you are seeing?

Robert W

Hi Robert,

Here are the urls and then the Created Dates returned.

deployments?taskState=Success

[ ‘2016-08-23T05:13:50.032+00:00’,

‘2016-08-25T21:18:20.233+00:00’,

‘2016-08-30T03:24:34.642+00:00’,

‘2016-08-31T09:49:10.784+00:00’,

‘2016-09-01T01:34:26.931+00:00’,

‘2016-09-01T22:02:07.631+00:00’,

‘2016-09-01T22:13:27.913+00:00’,

‘2016-09-02T01:32:39.731+00:00’,

‘2016-09-02T01:42:22.563+00:00’,

‘2016-09-02T01:48:06.159+00:00’,

‘2016-09-02T03:20:10.810+00:00’,

‘2016-09-06T05:08:33.229+00:00’,

‘2016-09-06T09:20:06.286+00:00’,

‘2016-09-06T09:37:09.926+00:00’,

‘2016-09-06T10:27:46.536+00:00’,

‘2016-09-07T02:29:03.556+00:00’,

‘2016-09-11T23:56:28.348+00:00’,

‘2016-09-12T01:42:59.215+00:00’,

‘2016-09-12T01:53:23.948+00:00’,

‘2016-09-13T03:06:25.202+00:00’,

‘2016-09-14T01:53:03.252+00:00’,

‘2016-09-15T23:37:51.529+00:00’,

‘2016-09-16T02:38:19.629+00:00’,

‘2016-09-18T23:16:51.497+00:00’,

‘2016-09-19T00:48:04.665+00:00’,

‘2016-09-19T01:23:09.674+00:00’,

‘2016-09-19T02:56:56.302+00:00’,

‘2016-09-20T01:50:09.115+00:00’,

‘2016-09-20T05:35:06.094+00:00’,

‘2016-09-20T22:54:14.160+00:00’ ]


/api/deployments?skip=30&take=30&taskState=Success

[ ‘2016-09-23T04:21:22.450+00:00’,

‘2016-09-28T22:13:22.037+00:00’,

‘2016-09-28T22:17:14.763+00:00’,

‘2016-09-30T03:06:55.606+00:00’,

‘2016-09-30T04:00:20.404+00:00’,

‘2016-10-03T22:30:14.182+00:00’,

‘2016-10-09T21:46:11.539+00:00’,

‘2016-10-10T19:55:22.220+00:00’,

‘2016-10-10T22:57:20.539+00:00’,

‘2016-10-13T00:49:00.705+00:00’,

‘2016-10-27T21:02:06.487+00:00’,

‘2016-10-28T02:19:18.668+00:00’,

‘2016-10-30T22:34:05.455+00:00’,

‘2016-10-31T22:29:48.509+00:00’,

‘2016-11-01T00:52:47.423+00:00’,

‘2016-11-02T23:07:33.032+00:00’,

‘2016-11-03T23:07:14.648+00:00’,

‘2016-11-04T02:04:35.419+00:00’,

‘2016-11-06T23:26:03.221+00:00’,

‘2016-11-06T23:33:11.252+00:00’,

‘2016-11-07T01:43:19.065+00:00’,

‘2016-11-07T02:46:53.308+00:00’,

‘2016-11-07T02:51:27.323+00:00’,

‘2016-11-07T03:27:01.921+00:00’,

‘2016-11-08T03:42:01.109+00:00’,

‘2016-11-08T20:28:40.506+00:00’,

‘2016-11-08T20:37:52.571+00:00’,

‘2016-11-08T21:53:28.329+00:00’,

‘2016-11-08T22:59:48.919+00:00’,

‘2016-11-10T02:26:50.503+00:00’ ]


/api/deployments?skip=60&take=30&taskState=Success

[ ‘2016-11-11T03:54:46.791+00:00’,

‘2016-11-11T03:59:57.073+00:00’,

‘2016-11-14T09:45:11.075+00:00’,

‘2016-11-14T20:11:20.021+00:00’,

‘2016-11-14T22:34:17.655+00:00’,

‘2016-11-15T01:44:49.064+00:00’,

‘2016-11-15T02:05:38.824+00:00’,

‘2016-11-15T02:11:24.143+00:00’,

‘2016-11-16T00:08:59.151+00:00’,

‘2016-11-16T04:33:55.791+00:00’,

‘2016-11-16T04:34:32.590+00:00’,

‘2016-11-16T20:01:34.125+00:00’,

‘2016-11-16T21:47:50.313+00:00’,

‘2016-11-17T22:32:02.398+00:00’,

‘2016-11-17T22:47:34.181+00:00’,

‘2016-11-18T00:36:12.376+00:00’,

‘2016-11-18T06:30:00.557+00:00’,

‘2016-11-20T22:37:06.941+00:00’,

‘2016-11-21T01:11:05.909+00:00’,

‘2016-11-21T03:36:44.303+00:00’,

‘2016-11-21T03:37:55.194+00:00’,

‘2016-11-21T03:41:25.738+00:00’,

‘2016-11-21T04:21:50.633+00:00’,

‘2016-11-21T21:34:27.355+00:00’,

‘2016-11-21T22:38:47.056+00:00’,

‘2016-11-21T23:22:01.928+00:00’,

‘2016-11-22T01:14:37.160+00:00’,

‘2016-11-22T01:34:57.806+00:00’,

‘2016-11-22T01:46:22.086+00:00’,

‘2016-11-22T02:16:45.990+00:00’ ]


/api/deployments?skip=90&take=30&taskState=Success

[ ‘2016-11-22T02:20:00.768+00:00’,

‘2016-11-22T02:20:47.969+00:00’,

‘2016-11-22T02:32:31.404+00:00’,

‘2016-11-22T02:56:09.008+00:00’,

‘2016-11-22T03:01:15.810+00:00’,

‘2016-11-22T10:21:00.744+00:00’,

‘2016-11-22T20:35:15.225+00:00’,

‘2016-11-22T20:45:33.225+00:00’,

‘2016-11-22T20:52:02.288+00:00’,

‘2016-11-22T21:12:42.266+00:00’,

‘2016-11-23T01:36:41.176+00:00’,

‘2016-11-23T02:15:01.571+00:00’,

‘2016-11-23T03:59:49.012+00:00’,

‘2016-11-23T22:18:12.443+00:00’,

‘2016-11-23T22:37:45.536+00:00’,

‘2016-11-24T00:35:10.347+00:00’,

‘2016-11-24T01:13:59.985+00:00’,

‘2016-11-24T01:17:45.667+00:00’,

‘2016-11-24T01:43:25.377+00:00’,

‘2016-11-24T02:30:10.583+00:00’,

‘2016-11-24T02:30:30.385+00:00’,

‘2016-11-24T03:25:23.863+00:00’,

‘2016-11-24T03:26:55.474+00:00’,

‘2016-11-24T03:43:38.934+00:00’,

‘2016-11-24T03:44:26.278+00:00’,

‘2016-11-24T03:47:38.026+00:00’,

‘2016-11-24T03:55:09.684+00:00’,

‘2016-11-24T04:29:22.421+00:00’,

‘2016-11-24T05:00:26.740+00:00’,

‘2016-03-01T03:32:27.738+00:00’ ]


/api/deployments?skip=120&take=30&taskState=Success

[ ‘2016-03-02T03:46:42.517+00:00’,

‘2016-03-03T20:59:07.413+00:00’,

‘2016-03-30T23:40:23.803+00:00’,

‘2016-04-06T00:18:06.511+00:00’,

‘2016-04-18T02:48:11.214+00:00’,

‘2016-05-02T04:44:24.620+00:00’,

‘2016-05-03T02:07:09.369+00:00’,

‘2016-05-18T03:00:40.715+00:00’,

‘2016-05-22T23:13:17.491+00:00’,

‘2016-06-09T05:35:18.968+00:00’,

‘2016-06-09T07:42:41.380+00:00’,

‘2016-06-09T07:57:09.494+00:00’,

‘2016-06-09T08:25:14.150+00:00’,

‘2016-06-09T09:35:50.677+00:00’,

‘2016-06-17T12:54:29.200+00:00’,

‘2016-06-17T12:56:28.633+00:00’,

‘2016-06-18T09:27:20.939+00:00’,

‘2016-06-28T03:16:01.682+00:00’,

‘2016-07-19T03:41:43.930+00:00’,

‘2016-07-27T01:48:35.807+00:00’,

‘2016-08-03T03:45:38.832+00:00’ ]


Interesting I just tried it without the taskState=Success and it works as expected, so it maybe the filter that is causing it?

Thanks for the help

Andrew Cox

Hi Andrew,

Thanks for that. I was able to reproduce it. The next release (3.5.3) should fix this problem. It is due sometime in the next few days.

If it doesn’t, please let me know.

Regards,

Robert W