Admin privileges are required for this resource.
This resource represents repository-wide Code Review settings that allow you to customize your code review workflow. These settings will affect all Code Reviews within a specific repository.
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.
unanimous_approval | boolean | True if approval of each assignee is required in order for code review to be approved. False by default. |
---|---|---|
auto_reopen | boolean | True if approved Code Reviews have to be automatically reopened if new commits are made to their branches. True by default. |
default_assignees | array | An array of embedded User objects that are assigned to the Code Review. |
id | integer | User ID. |
name | string | User full name. |
login | string | User login. |
string | User email address. | |
default_watchers | array | An array of embedded User and Team objects that were added to the Code Review as watchers. |
id | integer | User ID or Team ID, depending on type attribute. |
type | string | Can be User or Team. |
name | string | User name or Team name, depending on type attribute. |
login | string | User login. For User type only. |
string | User email address. For User type only. | |
color | string | Team’s color label. For Team type only. |
GET /api/{REPOSITORY_ID}/code_reviews/settings.json
Click to expand…
json http-response{
"unanimous_approval": false,
"auto_reopen": true,
"default_assignees": [
{
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
],
"default_watchers": [
{
"id": 1,
"type": "User",
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
]
}
PUT /api/{REPOSITORY_ID}/code_reviews/settings.json
{
"unanimous_approval": true,
"default_assignee_ids": [1,2,3],
"default_watchers_user_ids": [1,2,3],
"default_watchers_team_ids": [1,2,3]
}
Click to expand…
json http-responseSTATUS: 200
{
"unanimous_approval": true,
"auto_reopen": true,
"default_assignees": [
{
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
],
"default_watchers": [
{
"id": 1,
"type": "User",
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com"
}
]
}