This resource represents Issues from Code Review’s Issues sub-page. Any user with at least read access to a repository can add issues to any Code Review. Issues can be added to specific lines of code or to the Code Review as a whole. This API doesn’t support creation of Issues for lines of code.
We are gradually phasing out XML support from our API and this is one of the first resources that are provided only in JSON format. The format was also a bit adjusted compared to other resources: associated objects (like repositories and users) are now embedded into JSON itself, and there are no JSON root elements anymore.
id | integer | Issue ID. |
---|---|---|
resolved_at | datetime | Date and time when issue was resolved. |
resolved_by_user | hash | Embedded object of the User who resolved the issue. |
id | integer | User ID. |
name | string | User full name. |
login | string | User login. |
string | User email address. | |
comment | hash | Embedded Comment object that represents the Issue. |
body | string | Comment text (Markdown source.) |
rendered_body | string | Comment text (HTML.) |
line_num | integer | Line number if comment was made for a line of code. For comments made on diff pieces this will be right line number. |
line_num_left | integer | Left line number. For comments created on diff pieces. |
file_path | string | File path for which comment was created |
line_contents | string | For comments created on lines of code only. Contains contents of the line on which the comment was made. |
revision | string | Revision number (or SHA1 hash) of the associated commit. |
created_at | datetime | Date and time when the comment was created. |
updated_at | datetime | Date and time when the comment was last updated. |
author | hash | Comment author. |
id | integer | User ID. |
name | string | User full name. |
login | string | User login. |
string | User email address. |
body | string | Issue text with Markdown formatting. |
---|
Optional GET parameters:
GET /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues.json
Click to expand…
json http-response{
"page": 1,
"per_page": 25,
"total_pages": 1,
"page_entries": 1,
"total_entries": 1,
"issues": [
{
"id": 1,
"resolved_at": "2014/12/30 09:57:07 -0500",
"resolved_by_user": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
},
"comment": {
"body": "test",
"rendered_body": "<p>test</p>\n",
"line_num": null,
"line_num_left": null,
"file_path": null,
"line_contents": null,
"revision": null,
"created_at": "2014/12/29 21:31:44 -0500",
"updated_at": "2014/12/29 21:31:44 -0500",
"author": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
}
}
]
}
GET /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues/{ISSUE_ID}.json
Click to expand…
json http-response{
"id": 1,
"resolved_at": "2014/12/30 09:57:07 -0500",
"resolved_by_user": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
},
"comment": {
"body": "test",
"rendered_body": "<p>test</p>\n",
"line_num": null,
"line_num_left": null,
"file_path": null,
"line_contents": null,
"revision": null,
"created_at": "2014/12/29 21:31:44 -0500",
"updated_at": "2014/12/29 21:31:44 -0500",
"author": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
}
}
POST /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues.json
{
"issue": {
"body": "Fix bug"
}
}
Click to expand…
json http-response{
"id":3,
"resolved_at":null,
"comment":{
"body":"Fix bug",
"rendered_body":"<p>Fix bug</p>\n",
"line_num":null,
"line_num_left":null,
"file_path":null,
"line_contents":null,
"revision":null,
"created_at":"2014/12/31 10:37:24 -0500",
"updated_at":"2014/12/31 10:37:24 -0500",
"author":{
"id":1,
"name":"Ilya Sabanin",
"login":"ilya",
"email":"ilya@example.com"
}
}
}
PUT /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues/{ISSUE_ID}/resolve.json
Click to expand…
json http-responseSTATUS: 200
{
"id": 1,
"resolved_at": "2014/12/30 09:57:07 -0500",
"resolved_by_user": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
},
"comment": {
"body": "test",
"rendered_body": "<p>test</p>\n",
"line_num": null,
"line_num_left": null,
"file_path": null,
"line_contents": null,
"revision": null,
"created_at": "2014/12/29 21:31:44 -0500",
"updated_at": "2014/12/29 21:31:44 -0500",
"author": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
}
}
PUT /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues/{ISSUE_ID}/reopen.json
Click to expand…
json http-responseSTATUS: 200
{
"id": 1,
"resolved_at": null,
"comment": {
"body": "test",
"rendered_body": "<p>test</p>\n",
"line_num": null,
"line_num_left": null,
"file_path": null,
"line_contents": null,
"revision": null,
"created_at": "2014/12/29 21:31:44 -0500",
"updated_at": "2014/12/29 21:31:44 -0500",
"author": {
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
}
}
DELETE /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/issues/{ISSUE_ID}.json
Click to expand…
json http-responseHEAD 200 OK