summaryrefslogtreecommitdiff
path: root/doc/api/merge_requests.md
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-07-02 22:58:21 +0200
committerTomasz Maczukin <tomasz@maczukin.pl>2016-07-02 22:58:21 +0200
commitf1a85747ca94cfe0aea25416da1e2ba498b636be (patch)
treefd0ae2b443ee90b90fa61817be7e7ee23059c6c9 /doc/api/merge_requests.md
parent3a6ebb1fd624c216a4ce65380e64072793b7ccda (diff)
parentfc3402b7eaa9e9839ac2b7087d9582f518b0bf96 (diff)
downloadgitlab-ce-f1a85747ca94cfe0aea25416da1e2ba498b636be.tar.gz
Merge branch 'master' into dev-master
* master: (98 commits) Enable Style/EmptyLines cop, remove redundant ones Update CHANGELOG Cache results from jQuery selectors to retrieve namespace name Fix import button when import fail due the namespace already been taken Fix snippets comments not displayed Fix emoji paths in relative root configurations Exclude requesters from Project#members, Group#members and User#members Upgrade Thin from 1.6.1 to 1.7.0. Many squashed commits Cache autocomplete results Upgrade Sidekiq from 4.1.2 to 4.1.4. Upgrade seed-fu from 2.3.5 to 2.3.6 use has_many relationship with events Support creating a todo on issuables via API Expose target, filter by state as string Add todos API documentation and changelog Improve the request / withdraw access button Metrics for Rouge::Plugins::Redcarpet and Rouge::Formatters::HTMLGitlab Groundwork for Kerberos SPNEGO (EE feature) Update CHANGELOG 8.9.5 for runners related fixes ...
Diffstat (limited to 'doc/api/merge_requests.md')
-rw-r--r--doc/api/merge_requests.md98
1 files changed, 98 insertions, 0 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 2930f615fc1..f60b0d0ebc6 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -776,3 +776,101 @@ Example response:
"subscribed": false
}
```
+
+## Create a todo
+
+Manually creates a todo for the current user on a merge request. If the
+request is successful, status code `200` together with the created todo is
+returned. If there already exists a todo for the user on that merge request,
+status code `304` is returned.
+
+```
+POST /projects/:id/merge_requests/:merge_request_id/todo
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer | yes | The ID of a project |
+| `merge_request_id` | integer | yes | The ID of the merge request |
+
+```bash
+curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/27/todo
+```
+
+Example response:
+
+```json
+{
+ "id": 113,
+ "project": {
+ "id": 3,
+ "name": "Gitlab Ci",
+ "name_with_namespace": "Gitlab Org / Gitlab Ci",
+ "path": "gitlab-ci",
+ "path_with_namespace": "gitlab-org/gitlab-ci"
+ },
+ "author": {
+ "name": "Administrator",
+ "username": "root",
+ "id": 1,
+ "state": "active",
+ "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+ "web_url": "https://gitlab.example.com/u/root"
+ },
+ "action_name": "marked",
+ "target_type": "MergeRequest",
+ "target": {
+ "id": 27,
+ "iid": 7,
+ "project_id": 3,
+ "title": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
+ "description": "Veniam sunt nihil modi earum cumque illum delectus. Nihil ad quis distinctio quia. Autem eligendi at quibusdam repellendus.",
+ "state": "opened",
+ "created_at": "2016-06-17T07:48:04.330Z",
+ "updated_at": "2016-07-01T11:14:15.537Z",
+ "target_branch": "allow_regex_for_project_skip_ref",
+ "source_branch": "backup",
+ "upvotes": 0,
+ "downvotes": 0,
+ "author": {
+ "name": "Jarret O'Keefe",
+ "username": "francisca",
+ "id": 14,
+ "state": "active",
+ "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon",
+ "web_url": "https://gitlab.example.com/u/francisca"
+ },
+ "assignee": {
+ "name": "Dr. Gabrielle Strosin",
+ "username": "barrett.krajcik",
+ "id": 4,
+ "state": "active",
+ "avatar_url": "http://www.gravatar.com/avatar/733005fcd7e6df12d2d8580171ccb966?s=80&d=identicon",
+ "web_url": "https://gitlab.example.com/u/barrett.krajcik"
+ },
+ "source_project_id": 3,
+ "target_project_id": 3,
+ "labels": [],
+ "work_in_progress": false,
+ "milestone": {
+ "id": 27,
+ "iid": 2,
+ "project_id": 3,
+ "title": "v1.0",
+ "description": "Quis ea accusantium animi hic fuga assumenda.",
+ "state": "active",
+ "created_at": "2016-06-17T07:47:33.840Z",
+ "updated_at": "2016-06-17T07:47:33.840Z",
+ "due_date": null
+ },
+ "merge_when_build_succeeds": false,
+ "merge_status": "unchecked",
+ "subscribed": true,
+ "user_notes_count": 7
+ },
+ "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/merge_requests/7",
+ "body": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
+ "state": "pending",
+ "created_at": "2016-07-01T11:14:15.530Z"
+}
+```