All Products
Search
Document Center

Alibaba Cloud DevOps:CreateTestcaseComment - Create a comment for a test case

Last Updated:Jul 10, 2026

Creates a comment for a specified test case.

Endpoint and authorization information

Product

Resource

Required permission

Test Management

Test case

Read/Write

Request syntax

Region edition

POST 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.

testRepoId

string

path

Yes

The unique identifier of the test case library.

-

object

body

No

content

string

body

Yes

The comment content.

This is a comment.

formatType

string

body

No

The content format. Valid values: RICHTEXT and MARKDOWN. Default value: RICHTEXT.

RICHTEXT

parentId

string

body

No

The ID of the parent comment. Set this parameter to reply to an existing comment.

1112333

Request example

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/testRepos/{testRepoId}/testcases/{id}/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "content": "This is a comment.",
        "formatType": "RICHTEXT",
        "parentId": "1112333"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

The comment ID.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For the error codes of this operation, see Error code center.