Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining Associated Work Item Information
Updated on 2026-01-27 GMT+08:00

Obtaining Associated Work Item Information

Function

Obtain information about associated work items in a repository.

URI

GET /v2/repositories/{repository_uuid}/related-commits

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Explanation:

Repository UUID. For details, see the UUID returned by obtaining repository details.

Constraints

None.

Range:

32 digits and letters.

Default value

None.

type

No

Integer

Explanation:

Associated work item type.

Constraints

None.

Range:

  • 0: indicates associated work items from commits.
  • 1: indicates associated work items from merge requests.

Default value

0

search

No

String

Explanation:

Keyword used for the query.

Constraints

None.

Range:

None.

Default value

None.

page

No

Integer

Explanation:

Page number.

Constraints

None.

Range:

None.

Default value

1

per_page

No

Integer

Explanation:

Number of records on each page.

Constraints

None.

Range:

1–100

Default value

20

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

None.

Range:

1–100,000 characters.

Default value

None.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Object Error

Explanation:

Response error code.

Range:

None.

result

Object RelatedCommitListVo

Explanation:

Associated work item list.

Range:

None.

status

String

Explanation:

Response status of the API.

Range:

  • success: The API call is successful.
  • failed: The API call failed.

Table 4 Response error parameters

Parameter

Type

Description

code

String

Explanation:

Error code.

Range:

Max. 100 characters in the error code format.

message

String

Explanation:

Error message.

Range:

None.

Table 5 RelatedCommitListVo response parameters

Parameter

Type

Description

total

Integer

Explanation:

Number of returned results.

Range:

None.

list

Array RelatedCommitVo

Explanation:

Array of the returned results.

Range:

None.

Table 6 RelatedCommitVo response parameters

Parameter

Type

Description

id

String

Explanation:

Primary key ID of the associated work item.

Range:

None.

iamId

String

Explanation:

IAM user ID.

Range:

None.

userName

String

Explanation:

Username.

Range:

None.

repoId

String

Explanation:

Repository ID.

Range:

None.

tenantName

String

Explanation:

Tenant name.

Range:

None.

nickName

String

Explanation:

User alias.

Range:

None.

branchName

String

Explanation:

Branch name.

Range:

None.

commitId

String

Explanation:

Commit ID

Range:

None.

commitShortId

String

Explanation:

Commit short ID.

Range:

None.

commitMsg

String

Explanation:

Commit message.

Range:

None.

commitUrl

String

Explanation:

Commit URL.

Range:

None.

relatedId

String

Explanation:

Work item ID.

Range:

None.

createAt

String

Explanation:

Creation time.

Range:

None.

updateAt

String

Explanation:

Update time.

Range:

None.

relatedUrl

String

Explanation:

Work item URL.

Range:

None.

result

String

Explanation:

Association result.

Range:

  • 0: The association fails.
  • 1: The association is successful.

Example Requests

GET https://{endpoint}/v2/repositories/{repository_uuid}/related-commits

Example Responses

Status code: 200

OK
{
    "result":{ "total": 1
list: [{
        "id": "1",
        "iamId": "eab0854acdda4b3d90f51de6f9d6349e",
        "userName": "test",
        "tenantName": "tenant_name",
        "nickName": "nick_name",
        "repoId": "8",
        "userId": "6776",
        "branchName": "master",
        "commitId": "30baec6147897d404f1ed1f44a7dec0e300a2d271",
        "commitShortId": "30baec61",
        "commitMsg": "1",
        "commitUrl": "https://example.com/codehub/2111986349/30baec6147897d404f1ed1f44a7dec0e300a2d27/commitdetail",
         "relatedId": "9152325",
        "relatedUrl": "https://example.com/projectman/scrum/c1f7364751e0406b8d9a46f492cba662/task/detail/9152325",
        "result": 1,
        "createdAt": "",
        "updatedAt": ""
    }],
    "status": "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.