ListWorkitemRelationRecords - Get work item relations

Updated at:

Queries the relation records of a specified work item, such as parent items, sub-items, and associated items.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Get a personal access token.
  • Get organizationId: Required for Central edition only. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Project Collaboration

Work item relations

Read-only

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

id

string

path

Yes

Unique identifier of the work item.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

ID of the organization. Required only for Central edition.

relationType

string

query

Yes

Relation type. Valid values: PARENT (parent item), SUB (sub-item), ASSOCIATED (associated item), DEPEND_ON (dependency), and DEPENDED_BY (dependent).

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/relationRecords?relationType={relationType}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/workitems/{id}/relationRecords?relationType={relationType}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

gmtCreate

string

Time when the relation was created.

id

string

ID of the relation detail.

beda1775d1c3eca7dbdff5****

relationType

string

Relation type. Valid values: PARENT (parent item), SUB (sub-item), ASSOCIATED (associated item), DEPEND_ON (dependency), and DEPENDED_BY (dependent).

ASSOCIATED

resourceId

string

ID of the related resource.

beda1775d1c3eca7dbdff5****

resourceType

string

Type of the related resource.

WORKITEM

Response example

[
    {
        "gmtCreate": "",
        "id": "beda1775d1c3eca7dbdff5****",
        "relationType": "ASSOCIATED",
        "resourceId": "beda1775d1c3eca7dbdff5****",
        "resourceType": "WORKITEM"
    }
]

Error codes

For error codes of this API, see Error Code Center.