CreateWorkitemTestcaseRelationRecord - Create a work item-test case relation record

Updated at:

Applicable editions

Central edition, Region edition

Service endpoints and authorization information

  • Obtain the service endpoint: use it to replace the {domain} parameter in the API request syntax.

  • Obtain a personal access token.

  • Obtain the organizationId: required only for the Central edition. Go to the Organization Management console > Basic Information page to obtain the organization ID.

Product

Resource

Required permission

Project Collaboration

Work item related items

Read/write

Request syntax

Central edition

POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/testcaseRelationRecords

Region edition

POST https://{domain}/oapi/v1/projex/workitems/{id}/testcaseRelationRecords

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 work item.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

organizationId.

-

object

body

No

testcaseId

string

body

Yes

The unique identifier of the test case to associate.

beda1775d1c3eca7dbdff5****

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/testcaseRelationRecords' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "testcaseId": "beda1775d1c3eca7dbdff5****"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/workitems/{id}/testcaseRelationRecords' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "testcaseId": "beda1775d1c3eca7dbdff5****"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

id.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For more information, see the error code center for API-related error codes.