GetMergeRequest
Queries the details of a single merge request.
Operation description
This operation requires that the enterprise uses the new version of merge requests. You can verify this by checking whether the merge request page of the enterprise displays the new version.
Try it now
Test
RAM authorization
Request syntax
GET /api/v4/projects/{repositoryId}/merge_requests/{localId}/detail HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| repositoryId |
integer |
Yes |
The repository ID. |
2464454 |
| localId |
integer |
Yes |
The local ID of the merge request, which indicates the sequence number of the merge request in the repository. |
1 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The enterprise identifier, also known as the enterprise ID. This is a string that you can obtain from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId]. |
5ebbc0228123212b59xxxxx |
| accessToken |
string |
No |
The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or Security Token Service (STS) temporary authorization. |
f0b1e61db5961df5975a93f9129d2513 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
The request ID. |
F7B85D1B-D1C2-140F-A039-341859F130B9 |
| errorMessage |
string |
The error message. |
"" |
| errorCode |
string |
The error code. |
Openapi.RequestError |
| success |
boolean |
Indicates whether the call was successful. |
true |
| result |
object |
The returned result. |
|
| mrBizId |
string |
The unique ID of the merge request. |
bca90244c4b749e0b109df52ac0eb570 |
| projectId |
integer |
The repository ID. |
2369234 |
| localId |
integer |
The local ID of the merge request, which indicates the sequence number of the merge request in the repository. |
1 |
| createTime |
string |
The creation time in UTC format based on ISO 8601. |
2023-05-30T02:53:36Z |
| updateTime |
string |
The update time in UTC format based on ISO 8601. |
2023-05-30T02:53:36Z |
| mrType |
string |
The type of the merge request, which is typically CODE_REVIEW. Valid values:
|
CODE_REVIEW |
| sourceProjectId |
integer |
The source repository ID. |
2369234 |
| sourceBranch |
string |
The source branch. |
test-merge-request |
| targetProjectId |
integer |
The target repository ID. |
2369234 |
| targetBranch |
string |
The target branch. |
master |
| title |
string |
The title of the merge request. |
test-Merge request title |
| description |
string |
The description of the merge request. |
test-Specific description of the merge request |
| reviewers |
array<object> |
The list of reviewers. |
|
|
object |
The reviewer information. |
||
| id |
integer |
The user ID in Codeup. |
90452 |
| name |
string |
The username. |
test-codeup |
| username |
string |
The logon name of the user. |
root-test-codeup |
| state |
string |
The user status. Valid values:
|
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
The email address of the user. |
username@example.com |
|
| hasReviewed |
boolean |
Indicates whether the reviewer has completed the review. |
false |
| reviewOpinionStatus |
string |
The review decision. This parameter is empty if the review is not completed. Valid values:
|
NOT_PASS |
| reviewTime |
string |
The time when the reviewer completed the review. The value is in UTC format based on ISO 8601. This value is empty if the reviewer has not completed the review. |
2023-05-30T02:53:36Z |
| hasCommented |
boolean |
Indicates whether the reviewer has posted comments. |
true |
| author |
object |
The author information. |
|
| id |
integer |
The user ID in Codeup. |
19927 |
| name |
string |
The username. |
test-codeup |
| username |
string |
The logon name of the user. |
root-test-codeup |
| state |
string |
The user status. Valid values:
|
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
The email address of the user. |
username@example.com |
|
| subscribers |
array<object> |
The list of subscribers. |
|
|
object |
The subscriber information. |
||
| id |
integer |
The user ID in Codeup. |
90452 |
| name |
string |
The username. |
test-subscriber |
| username |
string |
The logon name of the user. |
test-subscriber |
| state |
string |
The user status. Valid values:
|
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
The email address of the user. |
username@example.com |
|
| status |
string |
The status of the merge request. Valid values:
|
UNDER_REVIEW |
| createFrom |
string |
The creation source. Valid values:
|
WEB |
| ahead |
integer |
The number of commits that the source branch is ahead of the target branch. |
1 |
| behind |
integer |
The number of commits that the target branch is behind the source branch. |
1 |
| todoList |
object |
The to-do list. |
|
| requirementCheckItems |
array<object> |
The list of checkpoint items. |
|
|
object |
The checkpoint item information. |
||
| itemType |
string |
The type of the checkpoint item. Valid values:
|
COMMENTS_CHECK |
| pass |
boolean |
Indicates whether the checkpoint item is passed. |
true |
| allRequirementsPass |
boolean |
Indicates whether all checkpoint items are passed. |
true |
| supportMergeFastForwardOnly |
boolean |
Indicates whether the fast-forward-only merge method is supported. |
true |
| detailUrl |
string |
The URL of the merge request details page. |
https://example.com/org/demo-repo/change/1 |
| webUrl |
string |
The URL for accessing the page. |
https://example.com/org/demo-repo |
| targetProjectNameWithNamespace |
string |
The full name of the target repository, including the complete group path. |
orgId / test-group / test-target-repo (with spaces on both sides of the slashes) |
| targetProjectPathWithNamespace |
string |
The full path of the target repository, including the complete group path. |
orgId/test-group/test-target-repo |
| mergedRevision |
string |
The merged version, which is the commit SHA. |
1a072f5367c21f9de3464b8c0ee8546e47764d2d |
Examples
Success response
JSON format
{
"requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
"errorMessage": "\"\"",
"errorCode": "Openapi.RequestError",
"success": true,
"result": {
"mrBizId": "bca90244c4b749e0b109df52ac0eb570",
"projectId": 2369234,
"localId": 1,
"createTime": "2023-05-30T02:53:36Z",
"updateTime": "2023-05-30T02:53:36Z",
"mrType": "CODE_REVIEW",
"sourceProjectId": 2369234,
"sourceBranch": "test-merge-request",
"targetProjectId": 2369234,
"targetBranch": "master",
"title": "test-Merge request title",
"description": "test-Specific description of the merge request",
"reviewers": [
{
"id": 90452,
"name": "test-codeup",
"username": "root-test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com",
"hasReviewed": false,
"reviewOpinionStatus": "NOT_PASS",
"reviewTime": "2023-05-30T02:53:36Z",
"hasCommented": true
}
],
"author": {
"id": 19927,
"name": "test-codeup",
"username": "root-test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
},
"subscribers": [
{
"id": 90452,
"name": "test-subscriber",
"username": "test-subscriber",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
}
],
"status": "UNDER_REVIEW",
"createFrom": "WEB",
"ahead": 1,
"behind": 1,
"todoList": {
"requirementCheckItems": [
{
"itemType": "COMMENTS_CHECK",
"pass": true
}
]
},
"allRequirementsPass": true,
"supportMergeFastForwardOnly": true,
"detailUrl": "xxx",
"webUrl": "xxx",
"targetProjectNameWithNamespace": "orgId / test-group / test-target-repo (spaces on both sides of the slashes)",
"targetProjectPathWithNamespace": "orgId/test-group/test-target-repo",
"mergedRevision": "1a072f5367c21f9de3464b8c0ee8546e47764d2d"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.