Obtaining Commit Information Associated with a Work Item
Function
Commit information associated with a work item
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET https://{hostURL}/v4/projects/{project_id}/items/{item_id}/commits
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: You can obtain the unique project identifier, 32-character UUID, by calling the API used to query the project list. Value range: 32 characters |
| item_id | Yes | String | Definition: Work item ID Constraints: N/A Value range: 1 to 128 characters. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | No | String | Definition: Commit type associated with a work item Constraints: N/A Value range: Default value: commit Enumeration values: |
| offset | No | Integer | Definition Offset, which starts from 0. Value range: 0~2147483647 Default value: 0 |
| limit | No | Integer | Definition Number of returned records. Value range: 1~100 Default value: 20 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints Mandatory. Range 1–100,000 characters. Default Value N/A. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| X-Total | String | Total number of results of the current request |
| Parameter | Type | Description |
|---|---|---|
| [items] | Array of ItemCommitDto objects | Commit information associated with a work item |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Association ID Value range: N/A Value range: 0~2147483647 |
| title | String | Definition: Merge request title Value range: N/A |
| result | Integer | Definition: Repository status Value range: Value range: 0~10 |
| type | String | Definition: Associated commit type Value range: |
| message | String | Definition: Cause of the association failure Value range: N/A |
| item_id | String | Definition: Work item ID Value range: N/A |
| repository_id | String | Definition: Repository ID Value range: N/A |
| branch_name | String | Definition: Branch name Value range: N/A |
| user_name | String | Definition: Username Value range: N/A |
| commit_id | String | Definition: Commit ID Value range: N/A |
| commit_short_id | String | Definition: Short commit ID Value range: N/A |
| commit_msg | String | Definition: Commit message Value range: N/A |
| commit_url | String | Definition: Commit access address Value range: N/A |
| iam_id | String | Definition: iamId. Value range: N/A |
| create_at | String | Definition: Creation time Value range: N/A |
| update_at | String | Definition: Update time Value range: N/A |
| item_url | String | Definition: Work item access address Value range: N/A |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Example Requests
GET https://{endpoint}/v4/projects/936c6b54d29446958a7e668d04eceaac/items/9261401/commits Example Responses
Status code: 200
OK
[ {
"id" : 2111625445,
"title" : null,
"result" : 3,
"type" : "commit",
"message" : null,
"iam_id" : "c369c68f1ff84679b5a8ed904d8bff1c",
"repository_id" : "2111984490",
"branch_name" : "dev1",
"user_name" : "CodeHub_beta_dev",
"commit_id" : "9052a9accb4b2838daefeda790bda8c871ee3551",
"commit_short_id" : "9052a9ac",
"commit_msg" : "Update README.md fix #9261401 dev123",
"commit_url" : "https://example.com/codehub/2111984490/9052a9accb4b2838daefeda790bda8c871ee3551/commitdetail",
"item_id" : "9261401",
"create_at" : "2025-09-17T07:58:59.000+00:00",
"update_at" : "null,",
"item_url" : "https://example.com/projectman/scrum/936c6b54d29446958a7e668d04eceaac/task/detail/9261401"
} ] Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
} Status code: 403
Bad Request
{
"error_code" : "DEV-23-50804",
"error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized |
| 403 | Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.