Help Center/ CodeArts Repo/ API Reference/ APIs/ Project (V2)/ Associating Work Items with a Branch
Updated on 2026-01-27 GMT+08:00

Associating Work Items with a Branch

Function

This API is used to associate work items with a branch.

URI

POST /v2/projects/issues

Request Parameters

Table 1 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.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

branch

Yes

String

Explanation

Branch name.

Constraints

None.

Range

None.

Default value

None.

project_id

Yes

String

Explanation

Project ID. For details, see Obtaining a Project ID.

Constraints

None.

Range

None.

Default value

None.

related_id

Yes

Array of strings

Explanation

Work item IDs to be associated

Constraints

None.

Range

None.

Default value

None.

repo_id

Yes

String

Explanation

Repository ID, which can be obtained by calling the API for querying all repositories of a user.

Constraints

None.

Range

None.

Default value

None.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation

Response error code.

Range

None.

status

String

Explanation

Response status.

Range

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Error

Parameter

Type

Description

code

String

Explanation

Error code.

Range

Max. 100 characters in the error code format.

message

String

Explanation

Error message.

Range

None.

Example Requests

POST https://{endpoint}/v2/projects/issues

{
  "project_id" : "a6142fa102b740988fe45cc40254d61c",
  "branch" : "unionsdk",
  "repo_id" : "2111616668",
  "related_id" : [ "5561081" ]
}

Example Responses

Status code: 200

OK

{
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.