Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
909e924f
Commit
909e924f
authored
Aug 30, 2019
by
Patrick Bajao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc: Add info about MR approval state public API
parent
af5f2424
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
doc/api/merge_request_approvals.md
doc/api/merge_request_approvals.md
+71
-0
No files found.
doc/api/merge_request_approvals.md
View file @
909e924f
...
...
@@ -525,6 +525,77 @@ PUT /projects/:id/merge_requests/:merge_request_iid/approvers
}
```
### Get approval state of merge request
>**Note:** This API endpoint is only available on 12.3 Starter and above.
You can request information about a merge request's approval state using the following endpoint:
```
GET /projects/:id/merge_requests/:merge_request_iid/approval_state
```
The
`approval_rules_overwritten`
will be
`true`
if the merge request level rules
are created for the merge request. If there's none, it'll be
`false`
.
This includes additional information about the users who already approved
(
`approved_by`
) and if a rule is already approved (
`approved`
).
**Parameters:**
| Attribute | Type | Required | Description |
|----------------------|---------|----------|---------------------|
|
`id`
| integer | yes | The ID of a project |
|
`merge_request_iid`
| integer | yes | The IID of MR |
```
json
{
"approval_rules_overwritten"
:
true
,
"rules"
:
[
{
"id"
:
1
,
"name"
:
"Ruby"
,
"rule_type"
:
"regular"
,
"eligible_approvers"
:
[
{
"id"
:
4
,
"name"
:
"John Doe"
,
"username"
:
"jdoe"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/0?s=80&d=identicon"
,
"web_url"
:
"http://localhost/jdoe"
}
],
"approvals_required"
:
2
,
"users"
:
[
{
"id"
:
4
,
"name"
:
"John Doe"
,
"username"
:
"jdoe"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/0?s=80&d=identicon"
,
"web_url"
:
"http://localhost/jdoe"
}
],
"groups"
:
[],
"contains_hidden_groups"
:
false
,
"approved_by"
:
[
{
"id"
:
4
,
"name"
:
"John Doe"
,
"username"
:
"jdoe"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/0?s=80&d=identicon"
,
"web_url"
:
"http://localhost/jdoe"
}
],
"source_rule"
:
null
,
"approved"
:
true
}
]
}
```
### Get merge request level rules
>**Note:** This API endpoint is only available on 12.3 Starter and above.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment