CreateWorkitemRelationRecord

Updated at:

Applicable editions

Central edition, Region edition

Prerequisites

Product

Resource

Required permissions

Projex

workitem relation record

Read/Write

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example

id

string

path

Yes

The workitem ID.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

-

object

body

No

operatorId

string

body

No

The operator's user ID. Ignored when a personal access token is used.

1965154...

relationType

string

body

No

The relation type. Valid values:
• PARENT: parent
• SUB: sub-item
• ASSOCIATED: associated item
• DEPEND_ON: dependency
• DEPENDED_BY: dependent













ASSOCIATED

workitemId

string

body

No

The ID of the related workitem.

beda1775d1c3eca7dbdff5****

Request example

Central edition

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

Region edition

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

Response parameters

Parameter

Type

Description

Example

-

object

id

string

The ID of the workitem relation record.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For API error codes, see the Error Code Center.