Default Reviewer List Resource¶
Name | default_reviewers |
URI | /api/default-reviewers/ |
Description | 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. |
HTTP Methods | |
Parent Resource | Root List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Links¶
Name | Method | Resource |
---|---|---|
create | POST | Default Reviewer List Resource |
self | GET | Default Reviewer List Resource |
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 by one or more of the following arguments in the URL:
- repositories
- A comma-separated list of IDs of repositories that the default reviewer matches against. Only default reviewers that match every specified repository will be returned.
- users
- A comma-separated list of usernames that the default reviewer applies. Only default reviewers that apply each of these users will be returned.
- groups
- A comma-separated list of group names that the default reviewer applies. Only default reviewers that apply each of these groups will be returned.
Request Parameters¶
Field | Type | Description |
---|---|---|
counts-only (optional) | Boolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
max-results (optional) | Integer | 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. |
start (optional) | Integer | 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. |
Errors¶
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¶
Field | Type | Description |
---|---|---|
file_regex (required) | String | The regular expression used to match file paths in newly uploaded diffs. |
groups (optional) | String | A comma-separated list of group names. |
name (required) | String | The name of the default reviewer entry. |
repositories (optional) | String | A comma-separated list of repository IDs. |
users (optional) | String | A comma-separated list of usernames. |
Examples¶
application/vnd.reviewboard.org.default-reviewers+json¶
{
"default_reviewers": [
{
"file_regex": "/docs/.*",
"groups": [],
"id": 1,
"links": {
"delete": {
"href": "http://reviews.example.com/api/default-reviewers/1/",
"method": "DELETE"
},
"self": {
"href": "http://reviews.example.com/api/default-reviewers/1/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/default-reviewers/1/",
"method": "PUT"
}
},
"name": "docs-team",
"repositories": [
{
"href": "http://reviews.example.com/api/repositories/1/",
"method": "GET",
"title": "Review Board SVN"
}
],
"users": [
{
"href": "http://reviews.example.com/api/users/doc/",
"method": "GET",
"title": "doc"
}
]
}
],
"links": {
"create": {
"href": "http://reviews.example.com/api/default-reviewers/",
"method": "POST"
},
"self": {
"href": "http://reviews.example.com/api/default-reviewers/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}
application/vnd.reviewboard.org.default-reviewers+xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<total_results>1</total_results>
<stat>ok</stat>
<default_reviewers>
<array>
<item>
<file_regex>/docs/.*</file_regex>
<users>
<array>
<item>
<href>http://reviews.example.com/api/users/doc/</href>
<method>GET</method>
<title>doc</title>
</item>
</array>
</users>
<links>
<self>
<href>http://reviews.example.com/api/default-reviewers/1/</href>
<method>GET</method>
</self>
<update>
<href>http://reviews.example.com/api/default-reviewers/1/</href>
<method>PUT</method>
</update>
<delete>
<href>http://reviews.example.com/api/default-reviewers/1/</href>
<method>DELETE</method>
</delete>
</links>
<repositories>
<array>
<item>
<href>http://reviews.example.com/api/repositories/1/</href>
<method>GET</method>
<title>Review Board SVN</title>
</item>
</array>
</repositories>
<groups>
<array>
</array>
</groups>
<id>1</id>
<name>docs-team</name>
</item>
</array>
</default_reviewers>
<links>
<self>
<href>http://reviews.example.com/api/default-reviewers/</href>
<method>GET</method>
</self>
<create>
<href>http://reviews.example.com/api/default-reviewers/</href>
<method>POST</method>
</create>
</links>
</rsp>