Default Reviewer List Resource¶
Added in 1.6.16
Provides information on default reviewers for review requests.
Review Board will apply any default reviewers that match the repository and any file path in an uploaded diff for new and updated review requests. A default reviewer entry can list multiple users and groups.
This is useful when different groups own different parts of a codebase. Adding DefaultReviewer entries ensures that the right people will always see the review request and discussions.
Default reviewers take a regular expression for the file path matching, making it flexible.
As a tip, specifying .*
for the regular expression would have this
default reviewer applied to every review request on the matched
repositories.
Details¶
Name | default_reviewers |
URI | /api/default-reviewers/ |
Token Policy ID | default_reviewer |
HTTP Methods | |
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
create | POST |
|
self | GET |
HTTP GET¶
Retrieves the list of default reviewers on the server.
By default, this lists all default reviewers. This list can be further filtered down through the query arguments.
Request Parameters¶
counts-onlyBoolean | If specified, a single |
groupsString | A comma-separated list of group names that each resulting default reviewer must apply to review requests. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
repositoriesString | A comma-separated list of IDs of repositories that each resulting default reviewer must match against. |
startInteger | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
usersString | A comma-separated list of usernames that each resulting default reviewer must apply to review requests. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
HTTP POST¶
Creates a new default reviewer entry.
Note that by default, a default reviewer will apply to review requests on all repositories, unless one or more repositories are provided in the default reviewer’s list.
Request Parameters¶
file_regexString | Required The regular expression used to match file paths in newly uploaded diffs. |
nameString | Required The name of the default reviewer entry. |
groupsString | A comma-separated list of group names. |
repositoriesString | A comma-separated list of repository IDs. |
usersString | A comma-separated list of usernames. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
application/vnd.reviewboard.org.default-reviewers+json¶
$ curl https://reviews.example.com/api/default-reviewers/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 837
Content-Type: application/vnd.reviewboard.org.default-reviewers+json
ETag: 9b3530dc2007e557898383aa466dc712e8f58bc1
Item-Content-Type: application/vnd.reviewboard.org.default-reviewer+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"default_reviewers": [
{
"file_regex": "/docs/.*",
"groups": [],
"id": 1,
"links": {
"delete": {
"href": "https://reviews.example.com/api/default-reviewers/1/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/default-reviewers/1/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/default-reviewers/1/",
"method": "PUT"
}
},
"name": "docs-team",
"repositories": [
{
"href": "https://reviews.example.com/api/repositories/1/",
"method": "GET",
"title": "Review Board SVN"
}
],
"users": [
{
"href": "https://reviews.example.com/api/users/doc/",
"method": "GET",
"title": "doc"
}
]
}
],
"links": {
"create": {
"href": "https://reviews.example.com/api/default-reviewers/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/default-reviewers/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}