Querying the Associated Items of a Work Item
Function
This API is used to query all associations (including parent-child relationships, upstream and downstream collaboration, and common associations) of a work item based on the project ID and work item ID. Pagination query, relationship field filtering, and cross-project association query are supported.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v2/ipdprojectservice/projects/{project_id}/issues/{issue_id}/associated-item
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition 32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID. Constraints N/A Range A string of 32 characters consisting of letters and digits. Default Value N/A |
| issue_id | Yes | String | Definition Unique ID of a work item. You can obtain the value from the Querying Work Items or Querying Tree-shaped Work Items API. The value is id in the response body. Constraints N/A Range A string of 18 to 19 digits. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| issue_type | Yes | String | Definition Work item type. Constraints N/A Range N/A Default Value N/A |
| domain_id | No | String | Definition Project space ID, which can be obtained by calling the API for querying the IPD project list. The value of domain_id in the response body is the project space ID. Constraints N/A Range N/A Default Value N/A |
| target_project_id | No | String | Definition 32-character UUID of the target project, which uniquely identifies a project. Obtain the value of this parameter from the project_id field in the response body of the API for querying the IPD project list. Constraints N/A Range N/A Default Value N/A |
| link_field_code | No | String | Definition Code of the associated field. Constraints N/A Range N/A Default Value N/A |
| page_no | No | String | Definition Current page. Constraints N/A Range N/A Default Value 1 |
| page_size | No | String | Definition Page size. Constraints N/A Range N/A Default Value 100 |
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 N/A Range 10 to 32,768 characters Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Definition Response status. Range success: The response is successful. error: The response failed. |
| message | String | Definition Information. Range N/A |
| result | IssueListResult object | Definition Result data. |
| Parameter | Type | Description |
|---|---|---|
| issues | Array of IssueVO objects | Definition Work item list. Range N/A |
| total | Integer | Definition Total number of work items that meet the filter criteria. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| sys_analysis_conclusion | String | Definition Analysis conclusion, which is filled during RR acceptance. Range N/A |
| sys_remark | String | Definition Remarks. This field is filled during RR submission for acceptance. Range N/A |
| promised | OptionVO object | Definition Promised or not. This field is filled during RR acceptance. Range N/A |
| type | String | Definition Work item type. Range feature |
| belong_inside | String | Definition Whether a work item is submitted across projects. Range |
| src_domain | DomainVO object | Definition ID of the project space where the work item is created. Range N/A |
| domain_id | DomainVO object | Definition ID of the project space to which the work item belongs. Range N/A |
| send_from | String | Definition ID of the raw requirement's upstream requirement. Range N/A |
| number | String | Definition Work item ID, which consists of the work item type, year, month, day, and six random digits. For example, an IR created on September 30, 2025 may be numbered RR20250930982833. Range N/A |
| send_to | String | Definition ID of the raw requirement's downstream requirement. Range N/A |
| path | String | Definition Path between the parent and child work items. Range N/A |
| workload_man_day | String | Definition Planned workloads of a work item. Range N/A |
| sys_check_conclusion | String | Definition Acceptance conclusion. This field is filled during RR acceptance. Range N/A |
| id | String | Definition Unique ID of a work item. Range N/A |
| state | String | Definition Work item lifecycle. Range |
| stay_days | Integer | Definition Number of days that a work item stays in the current status. Range N/A |
| assigned_cc | Array of UserVO objects | Definition Cc recipient. Range N/A |
| submit_time | String | Definition Submission time of a work item. It is the time when the work item enters the workflow, rather than the creation time. Range N/A |
| workitem2label | Array of WorkItemLabelVO objects | Definition Work item label. Range N/A |
| sys_return_conclusion | String | Definition Reason for return. This field is filled when an RR/bug is returned. Range N/A |
| close_time | String | Definition Completion time of a work item. Range N/A |
| priority | OptionVO object | Definition Priority. Range |
| modified_date | String | Definition Last modification time of a work item. Range N/A |
| created_by | UserVO object | Definition Work item creator. Range N/A |
| break_status | OptionVO object | Definition Breakdown status. Range N/A |
| status_modified_date | String | Definition Time when the work item was last transferred, which can be used to calculate the stay days. The value is a UNIX timestamp in milliseconds. Range N/A |
| expect_delivery_time | String | Definition Expected completion time. The value is a UNIX timestamp in milliseconds. Range N/A |
| parent_id | String | Definition Parent work item ID of a work item. Range N/A |
| assignee | UserVO object | Definition Owner. Range N/A |
| region | String | Definition Domain of the tenant to which the work item belongs. Range N/A |
| status | AlmStatus object | Definition Work item status. Range N/A |
| tenant_id | String | Definition ID of the tenant to which the work item belongs. Range N/A |
| plan_pi | PlanVO object | Definition Release to which a work item belongs. Range N/A |
| link | String | Definition Relationship field of the associated work item. Use commas (,) to separate multiple values. Range N/A |
| description | String | Definition Work item description. A maximum of 500,000 characters are supported. Range N/A |
| is_suspended | OptionVO object | Definition Suspended or not. Range N/A |
| change_status | OptionVO object | Definition Change review status of a work item. Range N/A |
| title | String | Definition Work item title. Range N/A |
| sum_workload_man_day | String | Definition Actual workloads of a work item. Range N/A |
| sys_close_reason | String | Definition Reason for closing a work item. Range N/A |
| sys_resubmit_reason | String | Definition Reason for resubmission, which is used when resubmitting a returned RR/bug. Range N/A |
| plan_end_date | String | Definition Planned completion time of a work item. Range N/A |
| rr2ir | String | Definition ID of the child IR of an RR. Use commas (,) to separate multiple values. Range N/A |
| category_layer_id | String | Definition Work item type level ID. Range N/A |
| submitted_by | Array of UserVO objects | Definition Work item submitter. Range N/A |
| rr2us | String | Definition ID of the child US of an RR. Use commas (,) to separate multiple values. Range N/A |
| sys_no_develop_reason | String | Definition Reason why no development is requirement for the work item. Range N/A |
| plan_iteration | PlanVO object | Definition Sprint to which the work item belongs. Range N/A |
| sys_return_reason | String | Definition Reason for return. It is usually used when returning an RR/bug. Range N/A |
| cascade_delete | String | Definition Flag indicating whether to perform cascading deletion. Range N/A |
| recipient | Array of UserVO objects | Definition Receiver. It is usually used for RRs. Range N/A |
| modified_by | Array of UserVO objects | Definition Last modifier of a work item. Range N/A |
| created_date | String | Definition Creation time of a work item. Range N/A |
| category | String | Definition Work item type. Range |
| collaborative_status | String | Definition Collaboration status of an R&D requirement. Range N/A |
| project | DomainVO object | Definition Project to which the work item belongs. Range N/A |
| child_issues | Map<String,IssueVO> | Definition Child work item list. Range N/A |
| activate_times | Integer | Definition Number of activation times. The value is automatically assigned when the bug is activated. Range N/A |
| baseline | OptionVO object | Definition Work item baseline status. Range N/A |
| business_domain | OptionVO object | Definition Domain of a work item. Range |
| children | String | Definition ID of a child work item. Use commas (,) to separate multiple values. Range N/A |
| collaborative_history | String | Definition Change history of a collaborative requirement's status. The value is a JSON string. Range N/A |
| collaboratives | String | Definition R&D requirement collaboration task ID. Obtain the value from the Querying Tree-shaped Work Items API. The value is collaboratives in the response body. Range N/A |
| convolution_actual_hours | String | Definition Actual roll-up workloads, summed from the actual workloads of all the child and collaborative work items. Range N/A |
| convolution_plan_hours | String | Definition Planned roll-up workloads, summed from the planned workloads of all the child and collaborative work items. Range N/A |
| develop_owner | String | Definition Development owner. This field is usually used for nodes in the developing status. Range N/A |
| done_ratio | OptionVO object | Definition Progress. Range N/A |
| expected_repair_date | String | Definition Expected fixing time. Range N/A |
| feature2ir | String | Definition ID of the child IR of an SF. Use commas (,) to separate multiple values. Range N/A |
| feature_set | OptionVO object | Definition Feature set to which the SF belongs. Range N/A |
| found_env | OptionVO object | Definition Environment. Range N/A |
| found_iteration | PlanVO object | Definition Sprint. Range N/A |
| found_pi | PlanVO object | Definition Release. Range N/A |
| function_scene | String | Definition Function scenario. Range N/A |
| ir2feature | String | Definition ID of the SF associated with an IR. An IR can be associated with only one SF. Range N/A |
| ir2rr | String | Definition ID of the parent RR associated with an IR. Use commas (,) to separate multiple values. Range N/A |
| issue_opinion_id | String | Definition ID of the decision comment associated with a work item. Range N/A |
| issue_review_id | String | Definition ID of the review comment associated with a work item. Range N/A |
| module | OptionVO object | Definition Module. Range N/A |
| need_break | OptionVO object | Definition Whether work item breakdown is required. Range |
| need_develop | OptionVO object | Definition Whether development is required. Range N/A |
| no_break_reason | String | Definition Reason for no breakdown required. Range N/A |
| no_develop_reason | String | Definition Reason for no development required. Range N/A |
| order | Integer | Definition Priority order. Range 1–100 |
| plan_dev_end_date | String | Definition Planned development end time. This field is usually used for nodes in the developing status. The value is a UNIX timestamp in milliseconds. Range N/A |
| plan_processing_end_date | String | Definition Planned end time of processing. This field is usually used for in-progress nodes. The value is a UNIX timestamp in milliseconds. Range N/A |
| plan_researchanddevelop_end_date | String | Definition Planned R&D end time. This field is usually used for nodes in the R&D status. The value is a UNIX timestamp in milliseconds. Range N/A |
| plan_test_end_date | String | Definition Planned test end time. This field is usually used for nodes in the testing status. The value is a UNIX timestamp in milliseconds. Range N/A |
| position_float | String | Definition Initial position of a work item in the list. Range N/A |
| processing_owner | String | Definition Owner for in-progress nodes. This field is usually used for in-progress nodes. Range N/A |
| reason_analysis | String | Definition Reason analysis. Range N/A |
| regression_failure_number | Integer | Definition Number of times that regression failed. This field is automatically assigned when the bug test fails. Range N/A |
| related_network_security | OptionVO object | Definition Whether network security is involved. Range |
| repair_solution | String | Definition Fix solution. This field is usually used for bugs. Range N/A |
| researchanddevelop_owner | String | Definition R&D owner. This field is usually used for nodes in the R&D status. Range N/A |
| severity | OptionVO object | Definition Severity. Range N/A |
| sys_activation_reason | String | Definition Severity. Range N/A |
| sys_no_repair_reason | String | Definition Reason why rectification is not required. This field is used when the bug does not need to be fixed. Range N/A |
| test_failures_times | Integer | Definition Number of times that the test failed. Range N/A |
| test_owner | String | Definition Test owner. This field is usually used for nodes in the testing status. Range N/A |
| test_report | String | Definition Test report. Range N/A |
| val_feature | OptionVO object | Definition Value feature. Range N/A |
| workitem2ganttchart | String | Definition ID of the Gantt chart associated with a work item. Range N/A |
| workitem2mindmap | String | Definition ID of the mind map associated with a work item. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Label ID. Range A string of 18 to 19 digits. |
| category | String | Definition Object type. Range Label |
| label_type | String | Definition Type of the work item to which the label belongs, corresponding to the type field of the work item. The options are as follows. Range |
| color | String | Definition Label RGB color. Range The available color codes and their descriptions are as follows: |
| title | String | Definition Label title. Range 1 to 30 characters. |
| type | String | Definition Data type of the current object. Range label |
| state | String | Definition Lifecycle of a label. Range In use: The label is normal and can be used. Discarded: The label has been deleted and cannot be used. Deleted: The project to which the label belongs has been deleted and the label cannot be used. |
| modified_by | String | Definition Last modifier. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| user_id | String | Definition User ID. Range N/A |
| user_num_id | Integer | Definition Short ID of a user. Range N/A |
| user_name | String | Definition Username. Range N/A |
| domain_id | String | Definition ID of the domain to which the user belongs. Range N/A |
| domain_name | String | Definition Tenant name. Range N/A |
| nick_name | String | Definition User alias. Range N/A |
| role_id | String | Definition Role ID. If a user has multiple roles in a project, use commas (,) to separate the values. Range N/A |
| role_name | String | Definition Role name. If a user has multiple roles, use commas (,) to separate the values. Range N/A |
| role_code | String | Definition Role code. If a user has multiple roles, use commas (,) to separate the values. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Status ID. Range N/A |
| belonging | String | Definition Work item status. Range START: To Do state, such as Initial or Analyzing. IN_PROGRESS: Doing state, such as Fixing, Testing, or In R&D. END: Done state, such as Closed or Completed. |
| space_id | String | Definition ID of the project space to which the status belongs. Range N/A |
| name | String | Definition Status name. Range N/A |
| code | String | Definition Status code. Range N/A |
| definition_type | String | Definition Status definition level. The values 1, 2, and 3 indicate the system level, the value 4 indicates the tenant-defined level, and the value 5 indicates the project-defined level. Range N/A |
| belong_definition_type | Integer | Definition Status definition level. The values 1, 2, and 3 indicate the system level, the value 4 indicates the tenant-defined level, and the value 5 indicates the project-defined level. It is different from definition_type. If the definition level is system-level or tenant-defined, a copy of metadata is copied to the project space. Range N/A |
| display_value | String | Definition Status name, which is the same as the value of name. Range N/A |
| position | Integer | Definition Position sequence. Range N/A |
| displayable | Integer | Definition Display or not. Range N/A |
| editable | Integer | Definition Editable or not. Range N/A |
| deletable | Integer | Definition Deletable or not. Range N/A |
| mutable | Integer | Definition Whether the status value is fixed. Range N/A |
| title_py | String | Definition Initial letters of a title. Range N/A |
| created_by | String | Definition User ID of the creator. Range N/A |
| created_date | Integer | Definition Creation time. The value is a UNIX timestamp in milliseconds. Range N/A |
| modified_date | Integer | Definition Last modification time. The value is a UNIX timestamp in milliseconds. Range N/A |
| modified_by | String | Definition ID of the last modifier. Range N/A |
| linkage_node_fields | Boolean | Definition Whether to add the node owner/end time in the workflow configuration. Range true: The node owner/end time can be added to the status flow node. false: The node owner/end time cannot be added to the status flow node. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Unique ID of a project space. Range N/A |
| name | String | Definition Project space name. Range N/A |
| title | String | Definition Project space name. Range N/A |
| project_id | String | Definition 32-character UUID of a project space. Range N/A |
| parent_id | String | Definition Parent project space ID of the project space, which is used only in programs. Range N/A |
| category | String | Definition Project space type. Range |
| created_by | String | Definition ID of the project space creator. Range N/A |
| model_id | String | Definition Model ID corresponding to the project space. Range |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition: ID of a release, sprint, or milestone. Value range: N/A |
| title | String | Definition: Title. Options: N/A |
| category | String | Definition: Type. The value is of the enumerated type. Value range: PI: release Iteration: sprint PlanMilestone: milestone |
| description | String | Definition: Description Options: N/A |
| state | String | Definition Discard flag. The value is of the enumerated type. Range |
| status | String | Definition: Release/Sprint status. The value is of the enumerated type. Value range: planned: not started going: ongoing ended |
| children | Array of PlanVO objects | Definition: Sub-project sprint information. |
| created_by | String | Definition Creator ID. Range N/A |
| modified_by | String | Definition ID of the last updater. Range N/A |
| plan_start_date | String | Definition Planned start time, in the format of "yyyy-MM-dd". Example: 2024-01-01. Range N/A |
| plan_end_date | String | Definition Planned completion time, in the format of "yyyy-MM-dd". Example: 2024-01-01. Range N/A |
| created_date | Long | Definition: Creation time, which is a Unix timestamp (unit: millisecond). Options: N/A |
| parent_id | String | Definition Parent work item ID. When the plan type is iteration, this parameter specifies the release plan to which the work item belongs. Range N/A |
| baseline | String | Definition Baseline status. The value is of the enumerated type and indicates whether the plan has been included in baseline management. Range |
| workload | String | Definition Estimated workload, which is used to identify the required workforce or time investment for the plan. The unit is person/day. Range Max. 11 characters. |
| owner | String | Definition Owner ID, which identifies the owner of a plan. Range A string of 32 characters. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Option ID. Range N/A |
| display_value | String | Definition Option name. Range N/A |
| value | String | Definition Unique ID of an option. The ID and value of a custom option are the same. Range N/A |
| code | String | Definition Option code. Range N/A |
| value_py | String | Definition Initial letter of the Chinese pinyin of the option name. Range N/A |
| sequence | Integer | Definition Option's position in the list. Range N/A |
| level | Integer | Definition Hierarchical depth (1, 2, 3, or 4) of an option. For single-choice and multi-choice lists, the value is 1. Range 1: first level. Options in both single-choice and multi-choice lists belong to the first level. 2: second level. 3: third level. 4: fourth level. |
| domain_id | String | Definition ID of the project space to which the option belongs. Range N/A |
| belong_definition_type | String | Definition Definition level of the option. 1, 2, and 3 indicate the system level, 4 indicates the tenant-defined level, and 5 indicates the project-defined level. Range 1: system-preset option. 2: system-preset option. 3: system-preset option. 4: tenant-defined option. 5: project-defined option. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. Range N/A |
| error_msg | String | Definition Error description, which is a supplement to error_code. Range N/A |
Example Requests
Assume that the project ID is 26f251d688044d6ca53f7b1b8829d168 and the work item ID is 1211022056590450688. Query the associated items of the work item.
POST https://{endpoint}/v2/ipdprojectservice/projects/26f251d688044d6ca53f7b1b8829d168/issues/1211022056590450688/associated-item?issue_type=IR Example Responses
Status code: 200
{
"status" : "success",
"message" : "",
"result" : {
"total" : 1,
"data" : [ {
"category_layer_id" : "10004",
"link" : "1211022056590450688",
"title" : "222",
"priority" : {
"id" : "1210644901842948117",
"display_value" : "Medium",
"value" : "Medium",
"code" : "Medium",
"value_py" : "2",
"sequence" : 2,
"level" : 1,
"domain_id" : "1210644901016670209",
"belong_definition_type" : "2"
},
"domain_id" : {
"id" : "1210644901016670209",
"name" : "IPD-system device-111123",
"title" : "IPD-system device-111123",
"project_id" : "26f251d688044d6ca53f7b1b8829d168",
"category" : "Group",
"created_by" : "a360371833bf4c558f796fd707b44daf",
"model_id" : "10001",
"children" : [ ],
"project_template_id" : "10001",
"category_template_id" : "10001",
"feature_template_id" : "10001",
"is_managed_by_tenant" : false
},
"number" : "TASK20251230866467",
"setup" : true,
"id" : "1212785531721388033",
"assignee" : {
"user_id" : "a360371833bf4c558f796fd707b44daf",
"user_name" : "devcloud_devcloud_xxx_01",
"domain_id" : "4e919d73499648e3b0292cd3cbef806a",
"nick_name" : "fortest1",
"role_id" : "f0eaf447ad7540049f332cb75eaa777c,c172713f4c77465e89f1c619f894881c",
"role_name" : "Project admin,Project manager",
"role_alias_name" : "Project manager,Project admin",
"role_code" : "Project manager,project_admin"
},
"category" : "Task",
"collaborative_status" : [ ],
"status" : {
"id" : "1210644901859725331",
"belonging" : "START",
"name" : "Initial",
"code" : "Start",
"definition_type" : "5",
"belong_definition_type" : 3,
"display_value" : "Initial",
"linkage_node_fields" : false
}
} ]
}
} Status code: 400
{
"error_code" : "PM.02176813",
"error_msg" : "No permission."
} SDK Sample Code
The SDK sample code is as follows.
Java
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 | 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 QueryIssueAssociatedItemSolution { 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(); QueryIssueAssociatedItemRequest request = new QueryIssueAssociatedItemRequest(); request.withProjectId("{project_id}"); request.withIssueId("{issue_id}"); try { QueryIssueAssociatedItemResponse response = client.queryIssueAssociatedItem(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
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 | # 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 = QueryIssueAssociatedItemRequest() request.project_id = "{project_id}" request.issue_id = "{issue_id}" response = client.query_issue_associated_item(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
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 | 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.QueryIssueAssociatedItemRequest{} request.ProjectId = "{project_id}" request.IssueId = "{issue_id}" response, err := client.QueryIssueAssociatedItem(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 | Response to a successful request for querying associated items of a work item |
| 400 | Response to a failed request for querying associated items of a work item |
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