ListMergeRequestComments

Updated at:

Queries the list of comments in a merge request without pagination. Comments support only a three-level structure.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /api/v4/projects/merge_requests/comments/list_comments HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. This string can be obtained from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId].

60de7a6852743a5162b5f957

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

repositoryIdentity

string

Yes

The ID or full path of the code repository.

2835387 or codeup/codeup-demo

localId

integer

Yes

The local ID of the merge request, which indicates the sequence number of the merge request in the code repository.

10

body

object

No

The request body.

patchSetBizIds

array

No

The list of patch set business IDs.

Note

Each comment is associated with a patch set, which indicates the patch set version where the comment was posted. For global comments, the latest source patch set version is associated.

string

No

The patch set business ID.

5e733626d53f4b04a6aa0e23d4ff72b8

commentType

string

No

The comment type. Valid values:

  • GLOBAL_COMMENT: global comment

  • INLINE_COMMENT: inline file comment

GLOBAL_COMMENT

filePath

string

No

The file path.

/src/main/test.java

state

string

No

The comment state. Valid values:

  • DRAFT: draft

  • OPENED: published or opened

OPENED

resolved

boolean

No

Specifies whether the comment is resolved.

false

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

56C33A95-C04F-59F0-B3CD-E2A2EB9FADBB

success

boolean

Indicates whether the call is successful.

true

errorCode

string

The error code.

Openapi.RequestError

errorMessage

string

The error message.

""

result

array<object>

The list of returned results.

array<object>

The returned result.

Important Comment objects support only a three-level structure. If a comment uses a structure with more than three levels, the corresponding data is not returned.

commentBizId

string

The unique business ID of the comment.

5c399e3685e542a28db16d93e9f82abb

commentType

string

The comment type. Valid values:

  • GLOBAL_COMMENT: global comment

  • INLINE_COMMENT: inline file comment

GLOBAL_COMMENT

state

string

The comment state. Valid values:

  • DRAFT: draft

  • OPENED: published or opened

OPENED

resolved

boolean

Specifies whether the comment is resolved.

false

deleted

boolean

Indicates whether the comment is deleted.

false

commentTime

string

The time when the comment was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lastEditTime

string

The time when the comment was last edited. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

content

string

The content of the comment. The returned data is in rich text format.

{\"htmlValue\":\"

Test dynamic creation of overall comment 2

\",\"jsonMLValue\":[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"Test dynamic creation of overall comment 2\"]]]]}

author

object

The information about the commenter.

aliyunPk

string

The Alibaba Cloud account ID.

284692704493684695

name

string

The name of the user.

codeup

username

string

The logon name of the user.

test-codeup

state

string

The status of the user.

  • active: Active.

  • blocked: Temporarily unavailable.

active

avatarUrl

string

The URL of the avatar.

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

email

string

The email address of the user.

username@example.com

id

integer

The primary key ID. This ID has no business meaning.

19230

relatedPatchSet

object

The information about the associated patch set.

patchSetNo

string

The patch set number.

1

patchSetBizId

string

The unique business ID of the patch set.

513fcfd81a9142d2bb0db4f72c0aa15b

patchSetName

string

The name of the patch set.

Patch set 1

commitId

string

The commit ID associated with the patch set.

1a072f5367c21f9de3464b8c0ee8546e47764d2d

shortId

string

The short commit ID.

1a072f53

relatedMergeItemType

string

The associated merge type.

  • MERGE_SOURCE: Merge source.

  • MERGE_TARGET: Merge target.

MERGE_SOURCE

createdAt

string

The time when the patch set was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lineNumber

string

The line number in the file where the comment is located. This parameter is returned only for inline comments.

3

filePath

string

The file path.

src/main/test.java

parentCommentBizId

string

The business ID of the parent comment.

4c5dcec6a8dc41e69c369737dadc1841

rootCommentBizId

string

The business ID of the root comment.

dcf2b23cebfc418f98dbd35e423d9fd3

childComments

array<object>

The list of child comments.

array<object>

The information about the child comment.

commentBizId

string

The unique business ID of the comment.

63f0e293357f48f9846ddc4dbbebd0e3

commentType

string

The comment type. Valid values:

  • GLOBAL_COMMENT: global comment

  • INLINE_COMMENT: inline file comment

GLOBAL_COMMENT

state

string

The comment state. Valid values:

  • DRAFT: draft

  • OPENED: published or opened

OPENED

resolved

boolean

Specifies whether the comment is resolved.

false

deleted

boolean

Indicates whether the comment is deleted.

false

commentTime

string

The time when the comment was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lastEditTime

string

The time when the comment was last edited. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

content

string

The content of the comment. The returned data is in rich text format.

{\"htmlValue\":\" Test dynamic creation of overall comment 2 \",\"jsonMLValue\":[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"Test dynamic creation of overall comment 2\"]]]]}

author

object

The information about the commenter.

aliyunPk

string

The Alibaba Cloud account ID.

204485087002425236

name

string

The name of the user.

codeup

username

string

The logon name of the user.

test-codeup

state

string

The status of the user.

  • active: Active.

  • blocked: Temporarily unavailable.

active

avatarUrl

string

The URL of the avatar.

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

email

string

The email address of the user.

username@example.com

id

integer

The primary key ID. This ID has no business meaning.

132582

relatedPatchSet

object

The information about the associated patch set.

patchSetNo

string

The patch set number.

1

patchSetBizId

string

The unique business ID of the patch set.

513fcfd81a9142d2bb0db4f72c0aa15b

patchSetName

string

The name of the patch set.

Patch set 1

commitId

string

The commit ID associated with the patch set.

1a072f5367c21f9de3464b8c0ee8546e47764d2d

shortId

string

The short commit ID.

1a072f53

relatedMergeItemType

string

The associated merge type.

  • MERGE_SOURCE: Merge source.

  • MERGE_TARGET: Merge target.

MERGE_SOURCE

createdAt

string

The time when the patch set was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lineNumber

string

The line number in the file where the comment is located. This parameter is returned only for inline comments.

3

filePath

string

The file path.

src/main/test.java

parentCommentBizId

string

The business ID of the parent comment.

5c399e3685e542a28db16d93e9f82abb

rootCommentBizId

string

The business ID of the parent comment.

dcf2b23cebfc418f98dbd35e423d9fd3

finalChildComments

array<object>

The list of lowest-level child comments.

array<object>

The comment information.

commentBizId

string

The unique business ID of the comment.

5c399e3685e542a28db16d93e9f82abb

commentType

string

The comment type. Valid values:

  • GLOBAL_COMMENT: global comment

  • INLINE_COMMENT: inline file comment

GLOBAL_COMMENT

state

string

The comment state. Valid values:

  • DRAFT: draft

  • OPENED: published or opened

OPENED

resolved

boolean

Specifies whether the comment is resolved.

false

deleted

boolean

Indicates whether the comment is deleted.

false

commentTime

string

The time when the comment was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lastEditTime

string

The time when the comment was last edited. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

content

string

The content of the comment. The returned data is in rich text format.

{\"htmlValue\":\" Test dynamic creation of overall comment 2 \",\"jsonMLValue\":[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"Test dynamic creation of overall comment 2\"]]]]}

author

object

The information about the commenter.

aliyunPk

string

The Alibaba Cloud account ID.

235671547828975455

name

string

The name of the user.

codeup

username

string

The logon name of the user.

test-codeup

state

string

The status of the user.

  • active: Active.

  • blocked: Temporarily unavailable.

active

avatarUrl

string

The URL of the avatar.

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

email

string

The email address of the user.

username@example.com

id

integer

The primary key ID. This ID has no business meaning.

567035

relatedPatchSet

object

The information about the associated patch set.

patchSetNo

string

The patch set number.

1

patchSetBizId

string

The unique business ID of the patch set.

513fcfd81a9142d2bb0db4f72c0aa15b

patchSetName

string

The name of the patch set.

Patch set 1

commitId

string

The commit ID associated with the patch set.

1a072f5367c21f9de3464b8c0ee8546e47764d2d

shortId

string

The short commit ID.

1a072f53

relatedMergeItemType

string

The associated merge type.

  • MERGE_SOURCE: Merge source.

  • MERGE_TARGET: Merge target.

MERGE_SOURCE

createdAt

string

The time when the patch set was created. The time is in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

lineNumber

string

The line number in the file where the comment is located. This parameter is returned only for inline comments.

3

filePath

string

The file path.

src/main/test.java

parentCommentBizId

string

The business ID of the parent comment.

4c5dcec6a8dc41e69c369737dadc1841

rootCommentBizId

string

The business ID of the root comment.

dcf2b23cebfc418f98dbd35e423d9fd3

Examples

Success response

JSON format

{
  "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\\\":\\\"
测试动态创建整体评论-2\\\",\\\"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"
            }
          ]
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.