Review Request Draft Resource¶
Name | draft |
URI | /api/review-requests/{review_request_id}/draft/ |
Description | An editable draft of a review request. This resource is used to actually modify a review request. Anything made in this draft can be published in order to become part of the public review request, or it can be discarded. Any POST or PUTs on this draft will cause the draft to be created automatically. An initial POST is not required. There is only ever a maximum of one draft per review request. In order to access this resource, the user must either own the review request, or it must have the reviews.can_edit_reviewrequest permission set. |
HTTP Methods | |
Parent Resource | Review Request Resource |
Child Resources | |
Anonymous Access | No |
Fields¶
Field | Type | Description |
---|---|---|
branch | String | The branch name. |
bugs_closed | String | The new list of bugs closed or referenced by this change. |
changedescription | String | A custom description of what changes are being made in this update. It often will be used to describe the changes in the diff. |
description | String | The new review request description. |
id | Integer | The numeric ID of the draft. |
last_updated | String | The date and time that the draft was last updated (in YYYY-MM-DD HH:MM:SS format). |
public | Boolean | Whether or not the draft is public. This will always be false up until the time it is first made public. At that point, the draft is deleted. |
review_request | Review Request Resource | The review request that owns this draft. |
summary | String | The new review request summary. |
target_groups | String | A comma-separated list of review groups that will be on the reviewer list. |
target_people | String | A comma-separated list of users that will be on a reviewer list. |
testing_done | String | The new testing done text. |
Links¶
Name | Method | Resource |
---|---|---|
delete | DELETE | Review Request Draft Resource |
draft_screenshots | GET | Draft Screenshot List Resource |
self | GET | Review Request Draft Resource |
update | PUT | Review Request Draft Resource |
HTTP DELETE¶
Deletes a draft of a review request.
This is equivalent to pressing Discard Draft in the review request’s page. It will simply erase all the contents of the draft.
HTTP GET¶
Returns the current draft of a review request.
HTTP PUT¶
Updates a draft of a review request.
This will update the draft with the newly provided data.
Most of the fields correspond to fields in the review request, but there is one special one, public. When public is set to 1, the draft will be published, moving the new content to the Review Request itself, making it public, and sending out a notification (such as an e-mail) if configured on the server. The current draft will then be deleted.
Request Parameters¶
Field | Type | Description |
---|---|---|
branch (optional) | String | The new branch name. |
bugs_closed (optional) | String | A comma-separated list of bug IDs. |
changedescription (optional) | String | The change description for this update. |
description (optional) | String | The new review request description. |
public (optional) | Boolean | Whether or not to make the changes public. The new changes will be applied to the review request, and the old draft will be deleted. |
summary (optional) | String | The new review request summary. |
target_groups (optional) | String | A comma-separated list of review groups that will be on the reviewer list. |
target_people (optional) | String | A comma-separated list of users that will be on a reviewer list. |
testing_done (optional) | String | The new testing done text. |
Examples¶
application/json¶
{
"draft": {
"branch": "master",
"bugs_closed": [
"12",
"34"
],
"changedescription": "",
"description": "This is the new description.",
"id": 1,
"last_updated": "2010-08-16 00:47:29",
"links": {
"delete": {
"href": "http://reviews.example.com/api/review-requests/8/draft/",
"method": "DELETE"
},
"draft_screenshots": {
"href": "http://reviews.example.com/api/review-requests/8/draft/screenshots/",
"method": "GET"
},
"review_request": {
"href": "http://reviews.example.com/api/review-requests/8/",
"method": "GET",
"title": "Interdiff Revision Test"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/draft/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/review-requests/8/draft/",
"method": "PUT"
}
},
"public": false,
"summary": "This is the new summary",
"target_groups": [],
"target_people": [
{
"href": "http://reviews.example.com/api/users/grumpy/",
"method": "GET",
"title": "grumpy"
}
],
"testing_done": "This is the new testing that was done."
},
"stat": "ok"
}
application/xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<stat>ok</stat>
<draft>
<last_updated>2010-08-16 00:47:29</last_updated>
<description>This is the new description.</description>
<target_people>
<array>
<item>
<href>http://reviews.example.com/api/users/grumpy/</href>
<method>GET</method>
<title>grumpy</title>
</item>
</array>
</target_people>
<changedescription></changedescription>
<target_groups>
<array>
</array>
</target_groups>
<links>
<draft_screenshots>
<href>http://reviews.example.com/api/review-requests/8/draft/screenshots/</href>
<method>GET</method>
</draft_screenshots>
<self>
<href>http://reviews.example.com/api/review-requests/8/draft/</href>
<method>GET</method>
</self>
<review_request>
<href>http://reviews.example.com/api/review-requests/8/</href>
<method>GET</method>
<title>Interdiff Revision Test</title>
</review_request>
<update>
<href>http://reviews.example.com/api/review-requests/8/draft/</href>
<method>PUT</method>
</update>
<delete>
<href>http://reviews.example.com/api/review-requests/8/draft/</href>
<method>DELETE</method>
</delete>
</links>
<bugs_closed>
<array>
<item>12</item>
<item>34</item>
</array>
</bugs_closed>
<public>0</public>
<testing_done>This is the new testing that was done.</testing_done>
<branch>master</branch>
<summary>This is the new summary</summary>
<id>1</id>
</draft>
</rsp>