| Table of Contents |
Get a List of Reviews
| Description | Get a list of reviews |
URL | /api/reviews |
| Method | GET |
Security | Requires User role on the project |
| Number or Results | Results are limited to 200 reviews, ordered by creation date (most recent to oldest) |
Examples
Get reviews whose ids are 47 and 48:
Get all open reviews on project org.codehaus.sonar:sonar:
Parameters
Parameter | Description | Required | Default value |
|---|---|---|---|
ids | List of review ids | No | None |
resources | Comma-separated list of resource ids or keys | No | None |
projects | Comma-separated list of root project ids or keys | No | None |
statuses | Comma-separated list of status | No | None |
resolutions | Comma-separated list of resolutions | No | None |
severities | Comma-separated list of severities | No | None |
authors | Comma-separated list of author login | No | None |
assignees | Comma-separated list of assignee login | No | None |
review_type | Type of review | No | VIOLATION |
output | Format of comments | No | PLAIN |
| format | Response format: xml or json | No | xml |
Create a Review
| Description | Create an review |
URL | /api/reviews |
| Method | POST |
| Security | Requires authentication |
Examples
- Create a review on the violation of id '123':
- Status: OPEN
- Assignee: admin
Comment: myComment
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
violation_id | Violation on which the review should be created | Yes | None |
status | Initial status (can be 'OPEN' or 'RESOLVED') | Yes | None |
comment | Text of initial comment | No | None |
resolution | If status 'RESOLVED', then resolution must be provided (can be 'FIXED' or 'FALSE-POSITIVE') | No | None |
assignee | Login of initial assignee | No | None |
Add a Comment on a Review
| Description | Add a comment |
URL | /api/reviews/add_comment |
| Method | PUT |
| Security | Requires authentication |
Examples
Add the following comment on the review of id '345': 'myComment'
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
id | Review id | Yes | None |
comment | New comment | Yes | None |
Reassign a Review
| Description | Reassign a review |
URL | /api/reviews/reassign |
| Method | PUT |
| Security | Requires authentication |
Examples
Reassign the review of id '345' to user 'admin':
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
id | Review id | Yes | None |
assignee | Login of new assignee | Yes | None |
Resolve a Review
| Description | Resolve a review |
URL | /api/reviews/resolve |
| Method | PUT |
| Security | Requires authentication |
Examples
Flag the review of id '345' as false-positive:
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
id | Review id | Yes | None |
| resolution | Can be 'FIXED' or 'FALSE-POSITIVE' | Yes | None |
comment | No | None |
Reopen a Review
| Description | Reopen a review |
URL | /api/reviews/reopen |
| Method | PUT |
| Security | Requires authentication |
Examples
Reopen the review of id '345':
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
id | Review id | Yes | None |
comment |
| No | None |

