CreateWorkitemRelationRecord
|
Applicable editions |
Central edition, Region edition |
Prerequisites
- Obtain a service endpoint: Replace
{domain}in the API request syntax. - Obtain a personal access token.
- Obtain an organization ID: Required for the Central edition only. Go to the Basic Information page in the Organization Management Console to obtain the organization ID.
|
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 |
|
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: |
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.