API - GET /projects/:id/issues not working properly
Created by: raulpopadineti
Summary
GET /projects/:id/issues?state=all&page=1&page=50&order_by=updated_at&sort=desc
not working.
Steps to reproduce
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN"
-X GET 'https://gitlab.com/api/v3/projects/:id/issues?state=all&page=1&page=50&order_by=updated_at&sort=desc'
Expected behavior
Issues ordered by the updated_at
attribute in the descending order
Relevant logs and/or screenshots
[
{
"id": 1437718,
"iid": 4,
"project_id": 737122,
"title": "Issue 1",
"description": "description",
"state": "opened",
"created_at": "2016-04-05T12:32:51.079Z",
"updated_at": "2016-04-05T12:39:04.912Z",
"labels": [],
"milestone": null,
"assignee": null,
"author": {
"name": "Raul",
"username": "raulpopadineti",
"id": 368230,
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/cb02676d22f869f6660b3f580b55c1d9?s=80&d=identicon",
"web_url": "https://gitlab.com/u/raulpopadineti"
}
},
{
"id": 1229005,
"iid": 3,
"project_id": 737122,
"title": "Make the first commit",
"description": "",
"state": "opened",
"created_at": "2016-02-18T14:13:06.981Z",
"updated_at": "2016-04-05T13:18:32.518Z",
"labels": [],
"milestone": null,
"assignee": null,
"author": {
"name": "Raul",
"username": "raulpopadineti",
"id": 368230,
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/cb02676d22f869f6660b3f580b55c1d9?s=80&d=identicon",
"web_url": "https://gitlab.com/u/raulpopadineti"
}
},
{
"id": 1229000,
"iid": 2,
"project_id": 737122,
"title": "Init repo",
"description": "",
"state": "opened",
"created_at": "2016-02-18T14:07:48.566Z",
"updated_at": "2016-04-05T13:21:03.131Z",
"labels": [],
"milestone": null,
"assignee": null,
"author": {
"name": "Raul",
"username": "raulpopadineti",
"id": 368230,
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/cb02676d22f869f6660b3f580b55c1d9?s=80&d=identicon",
"web_url": "https://gitlab.com/u/raulpopadineti"
}
},
{
"id": 1007944,
"iid": 1,
"project_id": 737122,
"title": "Setup deployment server",
"description": "Buy a server from Digital Ocean\r\nInstall Ubuntu Server\r\nConfigure for our server API",
"state": "reopened",
"created_at": "2016-01-08T16:19:45.452Z",
"updated_at": "2016-04-05T12:30:31.955Z",
"labels": [],
"milestone": null,
"assignee": {
"name": "Raul",
"username": "raulpopadineti",
"id": 368230,
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/cb02676d22f869f6660b3f580b55c1d9?s=80&d=identicon",
"web_url": "https://gitlab.com/u/raulpopadineti"
},
"author": {
"name": "Raul",
"username": "raulpopadineti",
"id": 368230,
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/cb02676d22f869f6660b3f580b55c1d9?s=80&d=identicon",
"web_url": "https://gitlab.com/u/raulpopadineti"
}
}
]
Possible fixes
It should not list here that you can order and sort the results if it's not working properly: https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md#list-project-issues