Disassociating a Work Item
Function
Cancel the association between two work items. Only the project creator, project administrator, work item owner, creator, or users with edit permissions can perform this operation.
After cancellation, a journal record is generated.
Calling Method
For details, see Calling APIs.
Authorization Information
No identity policy-based permission required for calling this API.
URI
POST /v2/issues/cancel-associate
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User access credential. It can be obtained by calling the IAM API to obtain a user token (the value of X-Subject-Token in the response header). Constraints N/A Range 10 to 32,768 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| projectUUId | Yes | String | Definition Source project UUID, identifying the project to which the source work item for disassociation belongs. Constraints 32-character UUID string. This parameter is mandatory. Range 32 characters, consisting of lowercase letters and digits. Default Value N/A |
| attachProjectUUId | No | String | Definition Target project UUID, identifying the project to which the disassociated work item belongs. This parameter is mandatory for cross-project disassociation. Constraints 32-character UUID string. Range 32 characters, consisting of lowercase letters and digits. Default Value N/A |
| issueId | Yes | Integer | Definition Source work item ID. That is, the unique ID of the work item for which the association is to be disassociated. Constraints The work item must exist and must not be archived. Range N/A Default Value N/A |
| attachIssueId | Yes | Integer | Definition ID of the target work item to be disassociated. Constraints An association must already exist with the source work item. If not, error code DEV_21_400806 is returned. Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| result | result object | Definition Details of the canceled association records, including all attribute information of the association. |
| status | String | Definition Overall response status of the API. Range |
| Parameter | Type | Description |
|---|---|---|
| identifier | String | Definition Association ID. Range 32 characters, consisting of lowercase letters and digits. |
| issueId | Integer | Definition Source work item ID. Range N/A |
| projectId | Integer | Definition Numeric ID of the source project. Range N/A |
| associateType | String | Definition Association type. Range |
| associateIssueId | Integer | Definition ID of the associated work item. Range N/A |
| associateProjectId | Integer | Definition Numeric ID of the associated project. Range N/A |
| createdOn | String | Definition Association creation time. Range The format is yyyy-MM-dd HH:mm:ss. |
| authorId | Integer | Definition ID of the user who created the association. Range N/A |
| flag | Boolean | Definition Association validity flag. Range |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| {User defined key} | Map<String,ErrorRsp> | Response returned upon a failure. |
Example Requests
Work item 71058791 in project 45fba8eff9f3492585ce846767028f73 disassociates from another work item 71058792 in the same project.
POST https://{endpoint}/v2/issues/cancel-associate
{
"projectUUId" : "45fba8eff9f3492585ce846767028f73",
"attachProjectUUId" : "45fba8eff9f3492585ce846767028f73",
"issueId" : 71058791,
"attachIssueId" : 71058792
} Example Responses
Status code: 200
{
"result" : {
"identifier" : "27bdd22a0eeb4eefa431bebd2940b082",
"issueId" : 71058791,
"projectId" : 13628638,
"associateType" : "associate",
"associateIssueId" : 71058792,
"associateProjectId" : 13628638,
"createdOn" : "2026-09-01 20:37:39",
"authorId" : 1274137,
"flag" : true
},
"status" : "success"
} Status code: 400
{
"error" : {
"code" : "DEV_21_400806",
"reason" : "The work item association does not exist."
},
"status" : "error"
} SDK Sample Code
The SDK sample code is as follows.
Java
Work item 71058791 in project 45fba8eff9f3492585ce846767028f73 disassociates from another work item 71058792 in the same project.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.projectman.v4.region.ProjectManRegion; import com.huaweicloud.sdk.projectman.v4.*; import com.huaweicloud.sdk.projectman.v4.model.*; public class CancelScrumAssociateSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); ProjectManClient client = ProjectManClient.newBuilder() .withCredential(auth) .withRegion(ProjectManRegion.valueOf("<YOUR REGION>")) .build(); CancelScrumAssociateRequest request = new CancelScrumAssociateRequest(); CancelAssociateIssueRequest body = new CancelAssociateIssueRequest(); body.withAttachIssueId(71058792); body.withIssueId(71058791); body.withAttachProjectUUId("45fba8eff9f3492585ce846767028f73"); body.withProjectUUId("45fba8eff9f3492585ce846767028f73"); request.withBody(body); try { CancelScrumAssociateResponse response = client.cancelScrumAssociate(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
Work item 71058791 in project 45fba8eff9f3492585ce846767028f73 disassociates from another work item 71058792 in the same project.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkprojectman.v4 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = ProjectManClient.new_builder() \ .with_credentials(credentials) \ .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \ .build() try: request = CancelScrumAssociateRequest() request.body = CancelAssociateIssueRequest( attach_issue_id=71058792, issue_id=71058791, attach_project_uu_id="45fba8eff9f3492585ce846767028f73", project_uu_id="45fba8eff9f3492585ce846767028f73" ) response = client.cancel_scrum_associate(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
Work item 71058791 in project 45fba8eff9f3492585ce846767028f73 disassociates from another work item 71058792 in the same project.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := projectman.NewProjectManClient(hcClient) request := &model.CancelScrumAssociateRequest{} attachProjectUUIdCancelAssociateIssueRequest:= "45fba8eff9f3492585ce846767028f73" request.Body = &model.CancelAssociateIssueRequest{ AttachIssueId: int32(71058792), IssueId: int32(71058791), AttachProjectUUId: &attachProjectUUIdCancelAssociateIssueRequest, ProjectUUId: "45fba8eff9f3492585ce846767028f73", } response, err := client.CancelScrumAssociate(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
More
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
| Status Code | Description |
|---|---|
| 200 | The disassociation is successful. |
| 400 | The project, work item, or association does not exist. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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