查询合并请求中的评论列表,不分页。其中,评论仅支持三级结构。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
POST /api/v4/projects/merge_requests/comments/list_comments
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 60de7a6852743a5162b5f957 |
accessToken | string | 否 | 个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 | f0b1e61db5961df5975a93f9129d2513 |
repositoryIdentity | string | 是 | 代码库 ID 或者全路径 | 2835387 或 codeup/codeup-demo |
localId | long | 是 | 合并请求局部 ID,表示代码库下的第几个合并请求 | 10 |
body | object | 否 | 请求 Body | |
patchSetBizIds | array | 否 | 版本业务 ID 列表 说明
每个评论会关联一个版本,表示该评论发表在第几个版本,其中对于全局评论,关联的是最新的合并源版本。
| |
string | 否 | 版本业务 ID | 5e733626d53f4b04a6aa0e23d4ff72b8 | |
commentType | string | 否 | 评论类型
| GLOBAL_COMMENT |
filePath | string | 否 | 文件路径 | /src/main/test.java |
state | string | 否 | 评论状态
| OPENED |
resolved | boolean | 否 | 是否已解决 | false |
返回参数
示例
正常返回示例
JSON
格式
{
"requestId": "56C33A95-C04F-59F0-B3CD-E2A2EB9FADBB",
"success": true,
"errorCode": "Openapi.RequestError",
"errorMessage": "\"\"",
"result": [
{
"commentBizId": "5c399e3685e542a28db16d93e9f82abb",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54\n",
"lastEditTime": "2022-03-18 14:24:54\n",
"content": "{\\\"htmlValue\\\":\\\"<article class=\\\\\\\"4ever-article\\\\\\\"><p style=\\\\\\\"text-align:left;text-indent:0;margin-left:0\\\\\\\"><span>测试动态创建整体评论-2</span></p></article>\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "284692704493684695",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com",
"id": 19230
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54\n"
},
"lineNumber": "3",
"filePath": "src/main/test.java",
"parentCommentBizId": "4c5dcec6a8dc41e69c369737dadc1841",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3",
"childComments": [
{
"commentBizId": "63f0e293357f48f9846ddc4dbbebd0e3",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54",
"lastEditTime": "2022-03-18 14:24:54",
"content": "{\\\"htmlValue\\\":\\\"\n测试动态创建整体评论-2\n\n\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "204485087002425236",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com\n",
"id": 132582
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1\n",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54\n"
},
"lineNumber": "3",
"filePath": "src/main/test.java\n",
"parentCommentBizId": "5c399e3685e542a28db16d93e9f82abb",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3",
"finalChildComments": [
{
"commentBizId": "5c399e3685e542a28db16d93e9f82abb",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54",
"lastEditTime": "2022-03-18 14:24:54",
"content": "{\\\"htmlValue\\\":\\\"\n测试动态创建整体评论-2\n\n\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "235671547828975455",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com\n",
"id": 567035
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54"
},
"lineNumber": "3",
"filePath": "src/main/test.java",
"parentCommentBizId": "4c5dcec6a8dc41e69c369737dadc1841",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3\n"
}
]
}
]
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2024-01-29 | OpenAPI 返回结构发生变更 | 查看变更详情 |