Jump to >

Default Reviewer 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_reviewer
URI /api/default-reviewers/{default_reviewer_id}/
Token Policy ID default_reviewer
HTTP Methods
  • DELETE - Deletes the default reviewer entry.
  • GET - Retrieves information on a particular default reviewer.
  • PUT - Updates an existing default reviewer entry.
Parent Resource Default Reviewer List Resource
Child Resources None
Anonymous Access Yes, if anonymous site access is enabled

Fields

file_regexString The regular expression that is used to match files uploaded in a diff.
groupsString A comma-separated list of group names that this default reviewer applies to matched review requests.
idInteger The numeric ID of the default reviewer.
nameString The descriptive name of the entry.
repositoriesString A comma-separated list of repository IDs that this default reviewer will match against.
usersString A comma-separated list of usernames that this default reviewer applies to matched review requests.

HTTP DELETE

Deletes the default reviewer entry.

This will not remove any reviewers from any review requests. It will only prevent these default reviewer rules from being applied to any new review requests or updates.

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

HTTP GET

Retrieves information on a particular default reviewer.

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

HTTP PUT

Updates an existing default reviewer entry.

If the list of repositories is updated with a blank entry, then the default reviewer will apply to review requests on all repositories.

Request Parameters

file_regexString The regular expression used to match file paths in newly uploaded diffs.
groupsString A comma-separated list of group names.
nameString The name of the default reviewer entry.
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

Examples

application/vnd.reviewboard.org.default-reviewer+json

$ curl http://reviews.example.com/api/default-reviewers/1/ -H "Accept: application/json"
Vary: Accept, Cookie
ETag: 60804a727ee3fc4f83f148cf49c4b0aa536c81f2
Content-Type: application/vnd.reviewboard.org.default-reviewer+json
X-Content-Type-Options: nosniff
{
  "default_reviewer": {
    "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"
      }
    ]
  }, 
  "stat": "ok"
}