Queries the code submission records or branch creation records associated with the current work item.
Function
Queries the code submission records or branch creation records associated with the current work item.
URI
GET /v4/projects/{project_id}/issues/{issue_id}/associated-commits
| Parameter | Mandatory | Type | Description | 
|---|---|---|---|
| project_id | Yes | String | Specifies the 32-bit ID of the devcloud project. Minimum: 32 Maximum: 32 | 
| issue_id | Yes | Integer | Work Item ID | 
| Parameter | Mandatory | Type | Description | 
|---|---|---|---|
| type | No | String | Query type. The options are commit (submission record) and branch (branch record). | 
| limit | No | Integer | Number of records on each page | 
| offset | No | Integer | Offset | 
Request Parameters
| Parameter | Mandatory | Type | Description | 
|---|---|---|---|
| X-Auth-Token | Yes | String | Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. Minimum: 10 Maximum: 32768 | 
Response Parameters
Status code: 200
| Parameter | Type | Description | 
|---|---|---|
| commits | Array of CommitRecordDetail objects | Submission Record List | 
| total | Integer | Total | 
| Parameter | Type | Description | 
|---|---|---|
| repository_id | String | Warehouse ID | 
| branch_name | String | Branch Name | 
| commit_id | String | commit id | 
| commit_short_id | String | commit short id | 
| commit_msg | String | Commit information | 
| commit_url | String | commit URL | 
| user | SimpleUser object | User Information. | 
| type | String | Item type. | 
| create_date | String | Created | 
| update_date | String | Update time. | 
| Parameter | Type | Description | 
|---|---|---|
| user_num_id | Integer | User ID | 
| user_id | String | Indicates the user UUID. | 
| user_name | String | Account name | 
| nick_name | String | Nickname of the user. | 
Status code: 400
| Parameter | Type | Description | 
|---|---|---|
| error_msg | String | Description | 
| error_code | String | Error Codes | 
Status code: 401
| Parameter | Type | Description | 
|---|---|---|
| error_msg | String | Description | 
| error_code | String | Error Codes | 
Example Requests
GET https://{endpoint}/v4/projects/{project_id}/issues/{issue_id}/associated-commits
GET https://{endpoint}/v4/projects/a360371833bf4c558f796fd707b44daf/issues/122344/associated-commits
 Example Responses
Status code: 200
{
  "commits" : [ {
    "repository_id" : "1865706",
    "branch_name" : "master",
    "commit_id" : "f608b02311d90f311c41711fdf67003c31305b89",
    "commit_short_id" : "f608b023",
    "commit_msg" : "demo",
    "commit_url" : "https://xxx.xxx/xxxx/commit/791877f7d0e0b2032bc5e38425c1245e804e8741?ref=master",
    "user" : {
      "user_num_id" : 4091,
      "user_id" : "a360371833bf4c558f796fd707b44daf",
      "user_name" : "demo_user_name_xiongzhitest001",
      "nick_name" : "bear"
    },
    "type" : "branch",
    "create_date" : "2021-11-18 19:47:34",
    "update_date" : "2021-11-18 19:47:34"
  } ],
  "total" : "success"
}
 Status Codes
| Status Code | Description | 
|---|---|
| 200 | Ok | 
| 400 | Bad Request | 
| 401 | Unauthorized | 
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot 
    