ListMergeRequestComments – List comments

Updated at:

Retrieves comments on a merge request.

Applicable editions

Central edition,Region edition

Endpoint and authorization information

  • Get the endpoint: Replace the {domain} placeholder in the API request syntax.

  • Get a personal access token.

  • Obtain the organizationId: Required only for the Central edition. In the Organization Management console, go to the Basic Information page to obtain the organization ID.

Product

Resource

Required permission

Code Management

Merge request

Read-only

Request syntax

Central edition

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/changeRequests/{localId}/comments/list

Region edition

POST https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/changeRequests/{localId}/comments/list

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Your personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The repository ID or the full path URL-encoded.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

localId

integer

path

Yes

The merge request sequence number within the repository.

1

-

object

body

No

comment_biz_id_list

array[string]

body

No

Comment IDs to return. Results start from the root comment.

comment_type

string

body

No

The comment type.

GLOBAL_COMMENT,INLINE_COMMENT

file_path

string

body

No

The file path.

/src/main/test.java

patchset_biz_id_list

array[string]

body

No

Version business IDs.

resolved

boolean

body

No

Whether the comment is resolved.

false

state

string

body

No

The comment state.

DRAFT,OPENED

Request example

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/changeRequests/1/comments/list' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "comment_biz_id_list": [
            
        ],
        "comment_type": "GLOBAL_COMMENT,INLINE_COMMENT",
        "file_path": "/src/main/test.java",
        "patchset_biz_id_list": [
            
        ],
        "resolved": false,
        "state": "DRAFT,OPENED"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/changeRequests/1/comments/list' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "comment_biz_id_list": [
            
        ],
        "comment_type": "GLOBAL_COMMENT,INLINE_COMMENT",
        "file_path": "/src/main/test.java",
        "patchset_biz_id_list": [
            
        ],
        "resolved": false,
        "state": "DRAFT,OPENED"
    }'

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

author

object

User information.

avatar

string

The user avatar URL.

https://example/example/w/100/h/100

email

string

The user email address.

username@example.com

name

string

The user name.

codeup-name

state

string

The user state: active – activated and available; blocked – blocked and unavailable.

active

userId

string

The Apsara DevOps user ID.

62c795xxxb468af8

username

string

The user logon name.

codeup-username

child_comments_list

array[string]

Child comments.

[]

comment_time

string

The comment time.

2023-08-21T14:30:00Z

comment_type

string

The comment type.

INLINE_COMMENT

content

string

The comment content.

This is a comment content.

expression_reply_list

array

Reaction replies.

[]

-

object

emoji

string

The emoji character.

reply_user_list

array

The list of users who reacted.

-

object

reply_biz_id

string

The reply business ID.

1d8171cf0cc2453197fae0e0a27d5ece

reply_user

object

User information.

avatar

string

The user avatar URL.

https://example/example/w/100/h/100

email

string

The user email address.

username@example.com

name

string

The user name.

codeup-name

state

string

The user state: active – activated and available; blocked – blocked and unavailable.

active

userId

string

The Apsara DevOps user ID.

62c795xxxb468af8

username

string

The user logon name.

codeup-username

filePath

string

The file path.

/src/main/java/com/example/MyClass.java

from_patchset_biz_id

string

The source version ID.

c341efc7fa38425eb575ad6ab6e95e76

is_deleted

boolean

Whether the comment is deleted.

false

last_edit_time

string

The last edit time.

2023-08-21T15:00:00Z

last_edit_user

object

User information.

avatar

string

The user avatar URL.

https://example/example/w/100/h/100

email

string

The user email address.

username@example.com

name

string

The user name.

codeup-name

state

string

The user state: active – activated and available; blocked – blocked and unavailable.

active

userId

string

The Apsara DevOps user ID.

62c795xxxb468af8

username

string

The user logon name.

codeup-username

last_resolved_status_change_time

string

The last time the resolved status changed.

2023-08-21T16:00:00Z

last_resolved_status_change_user

object

User information.

avatar

string

The user avatar URL.

https://example/example/w/100/h/100

email

string

The user email address.

username@example.com

name

string

The user name.

codeup-name

state

string

The user state: active – activated and available; blocked – blocked and unavailable.

active

userId

string

The Apsara DevOps user ID.

62c795xxxb468af8

username

string

The user logon name.

codeup-username

line_number

integer

The line number.

42

location

object

can_located

boolean

Whether the comment can be located.

true

located_file_path

string

The located file path.

/src/main/java/com/example/Example.java

located_line_number

integer

The located line number.

100

located_patch_set_biz_id

string

The located patch set business ID.

1d8171cf0cc2453197fae0e0a27d5ece

mr_biz_id

string

The associated mrBizId.

bf117304dfe44d5d9b1132f348edf92e

out_dated

boolean

Whether the comment is outdated.

false

parent_comment_biz_id

string

The parent comment bizID.

1d8171cf0cc2453197fae0e0a27d5ece

project_id

integer

The repository ID.

123456

related_patchset

object

commitId

string

The commit ID for this version.

45ede4680536406d793e0e629bc771cb9fcaa153

createTime

string

The version creation time.

2024-10-05T15:30:45Z

patchSetBizId

string

The unique version ID.

bf117304dfe44d5d9b1132f348edf92e

patchSetName

string

The version name.

Version 1

ref

string

The ref information for this version.

null

relatedMergeItemType

string

The related type: MERGE_SOURCE – merge source; MERGE_TARGET – merge target.

MERGE_SOURCE

shortId

string

The abbreviated commit ID, typically eight characters.

45ede468

versionNo

integer

The version number.

1

resolved

boolean

Whether the comment is resolved.

false

root_comment_biz_id

string

The root comment bizId.

1d8171cf0cc2453197fae0e0a27d5ece

state

string

The comment state.

OPENED,DRAFT

to_patchset_biz_id

string

The target version ID.

c341efc7fa38425eb575ad6ab6e95e76

Response example

[
    {
        "author": {
            "avatar": "https://example/example/w/100/h/100",
            "email": "username@example.com",
            "name": "codeup-name",
            "state": "active",
            "userId": "62c795xxxb468af8",
            "username": "codeup-username"
        },
        "child_comments_list": [],
        "comment_biz_id": "bf117304dfe44d5d9b1132f348edf92e",
        "comment_time": "2023-08-21T14:30:00Z",
        "comment_type": "INLINE_COMMENT",
        "content": "This is a comment content.",
        "expression_reply_list": [],
        "filePath": "/src/main/java/com/example/MyClass.java",
        "from_patchset_biz_id": "c341efc7fa38425eb575ad6ab6e95e76",
        "is_deleted": false,
        "last_edit_time": "2023-08-21T15:00:00Z",
        "last_edit_user": {
            "avatar": "https://example/example/w/100/h/100",
            "email": "username@example.com",
            "name": "codeup-name",
            "state": "active",
            "userId": "62c795xxxb468af8",
            "username": "codeup-username"
        },
        "last_resolved_status_change_time": "2023-08-21T16:00:00Z",
        "last_resolved_status_change_user": {
            "avatar": "https://example/example/w/100/h/100",
            "email": "username@example.com",
            "name": "codeup-name",
            "state": "active",
            "userId": "62c795xxxb468af8",
            "username": "codeup-username"
        },
        "line_number": 42,
        "location": {
            "can_located": true,
            "located_file_path": "/src/main/java/com/example/Example.java",
            "located_line_number": 100,
            "located_patch_set_biz_id": "1d8171cf0cc2453197fae0e0a27d5ece"
        },
        "mr_biz_id": "bf117304dfe44d5d9b1132f348edf92e",
        "out_dated": false,
        "parent_comment_biz_id": "1d8171cf0cc2453197fae0e0a27d5ece",
        "project_id": 123456,
        "related_patchset": {
            "commitId": "45ede4680536406d793e0e629bc771cb9fcaa153",
            "createTime": "2024-10-05T15:30:45Z",
            "patchSetBizId": "bf117304dfe44d5d9b1132f348edf92e",
            "patchSetName": "Version 1",
            "ref": "null",
            "relatedMergeItemType": "MERGE_SOURCE",
            "shortId": "45ede468",
            "versionNo": 1
        },
        "resolved": false,
        "root_comment_biz_id": "1d8171cf0cc2453197fae0e0a27d5ece",
        "state": "OPENED,DRAFT",
        "to_patchset_biz_id": "c341efc7fa38425eb575ad6ab6e95e76"
    }
]

Error codes

For more information, see Error Code Center.