reviewers - /reviewers/ REST API

This page describes the REST endpoints that are added by the reviewers plugin.

Please also take note of the general information on the REST API.

Reviewers Endpoints

Get Reviewers

GET /projects/project_name/reviewers

Gets the default reviewers for specified project.

Request

  GET /projects/myproject/reviewers HTTP/1.0

As response a List of ReviewerFilter is returned that describes the default reviewers for myproject.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ],
      "cc": [
        "DevGroup"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]

Change Reviewers

POST /projects/project_name/reviewers

Changes the default reviewers for the specified project.

The change to reviewers must be provided in the request body inside a ConfigReviewersInput entity.

Caller must be a member of a group that is granted the ‘Modify Reviewers Config’ capability (provided by this plugin) or be a Project Owner for the project.

Request

  POST /projects/myproject/reviewers HTTP/1.0
  Content-Type: application/json;charset=UTF-8
  {
    "action": "ADD",
    "type": "REVIEWER"
    "filter": "branch:master",
    "reviewer": "UserA",
  }

As response the default reviewers are returned as a list of ReviewerFilter.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ]
      "ccs": [
        "DevGroup"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]

JSON Entities

ReviewerFilter

The ReviewerFilter entity contains a filter of the default reviewers.

ConfigReviewersInput

The ConfigReviewersInput entity contains an update for the default reviewers.

GERRIT

Part of Gerrit Code Review