ListTestcaseComments - List comments for a test case

Updated at:

Applicable editions

Central edition, Region edition

Endpoint and authorization information

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

  • Obtain an access token.

  • Get the organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to find the organization ID.

Product

Resource

Required permission

Test Management

Test case

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{testRepoId}/testcases/{id}/comments

Region edition

GET https://{domain}/oapi/v1/testhub/testRepos/{testRepoId}/testcases/{id}/comments

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

id

string

path

Yes

The unique identifier of the test case.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

testRepoId

string

path

Yes

The unique identifier of the test case library.

Request example

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{testRepoId}/testcases/{id}/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/testhub/testRepos/{testRepoId}/testcases/{id}/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

content

string

The comment content.

test

contentFormat

string

The content format. Valid values are RICHTEXT and MARKDOWN.

RICHTEXT

gmtCreate

string

The time when the comment was created.

gmtModified

string

The time when the comment was last modified.

id

string

The comment ID.

id-xxx

parentId

string

The parent comment ID.

1222333

top

boolean

Whether the comment is pinned to the top.

false

topTime

string

The time when the comment was pinned to the top.

user

object

id

string

The user ID.

674d96abd497cd558d68****

name

string

The username.

name-xxx

Response example

[
    {
        "content": "test",
        "contentFormat": "RICHTEXT",
        "gmtCreate": "",
        "gmtModified": "",
        "id": "id-xxx",
        "parentId": "1222333",
        "top": false,
        "topTime": "",
        "user": {
            "id": "674d96abd497cd558d68****",
            "name": "name-xxx"
        }
    }
]

Error codes

For error codes, see Error code center.