Querying Work Item Details
Function
This API is used to query work item details.
Calling Method
For details, see Calling APIs.
URI
GET /v4/projects/{project_id}/issues/{issue_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: 32-character UUID of a project, which uniquely identifies a project. Obtain the value of this parameter from the project_id field in the response body of the Querying the Project List API. Constraints: Regular expression: [A-Za-z0-9]{32} Options: N/A Default value: N/A |
issue_id |
Yes |
Integer |
Definition: Work item ID, which can be obtained from the Performing Advanced Query of Work Items API. The value of the id field in the response message body is the work item ID. Constraints: The value must contain 1 to 10 digits. Value range: Minimum length: 1 character. Maximum length: 10 characters. Default value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
accessories |
Array of IssueAccessory objects |
Definition: Attachment list. |
actual_work_hours |
Double |
Definition: Actual workloads. Options: Minimum value: 0. |
assigned_cc_user |
Array of IssueUser objects |
Definition: Cc recipient. |
assigned_user |
IssueUser object |
Definition: Handler. |
begin_time |
String |
Definition: Estimated start time. The format is YYYY-MM-DD. Options: N/A |
closed_time |
String |
Definition: Closing time. The format is YYYY-MM-DD HH:MM:SS. Options: N/A |
created_time |
String |
Definition: Creation time. The format is YYYY-MM-DD HH:MM:SS. Options: N/A |
creator |
IssueUser object |
Definition: Creator. |
custom_fields |
Array of CustomField objects |
Definition: Custom property value, which is not recommended. Refer to the new_custom_fields field. |
description |
String |
Definition: Work item description. Options: N/A |
developer |
IssueUser object |
Definition: Developer. |
domain |
domain object |
Parameter description: Domain. |
done_ratio |
Integer |
Parameter description: Work item completion rate. For example, 20 indicates that the completion rate is 20%. Options: Minimum value: 0. Maximum value: 100. |
end_time |
String |
Definition: Estimated end time. The format is YYYY-MM-DD. Options: N/A |
expected_work_hours |
Double |
Parameter description: Estimated workloads. Options: Minimum value: 0. |
id |
Integer |
Parameter description: Work item ID. Options: 0 to 9,999,999,999 |
iteration |
iteration object |
Parameter description: Sprint. |
module |
module object |
Parameter description: Module. |
name |
String |
Parameter description: Title. Options: N/A |
order |
IssueOrder object |
Definition: Sorting order. |
parent_issue |
parent_issue object |
Definition: Parent work item. |
priority |
priority object |
Definition: Work item priority. |
project |
IssueProjectResponseV4 object |
Definition: Project information. |
severity |
severity object |
Definition: Work item severity. |
status |
status object |
Definition: Work item status. |
story_point |
story_point object |
Definition: Story point. |
tracker |
tracker object |
Definition: Work item type. |
updated_time |
String |
Parameter description: Update time. The format is YYYY-MM-DD HH:MM:SS. Options: N/A |
new_custom_fields |
Array of IssueDetailCustomField objects |
Parameter description: Custom property value. |
Parameter |
Type |
Description |
---|---|---|
attachment_id |
Integer |
Definition: Attachment ID. Options: N/A |
container_type |
String |
Definition: Container type. Options: N/A |
created_date |
String |
Definition: Time when the attachment was created. The value is in the format of YYYY-MM-DD HH:MM:SS. Options: N/A |
creator_id |
String |
Definition: Creator UUID. Options: N/A |
creator_num_id |
Integer |
Definition: Digital ID of the creator. Options: N/A |
digest |
String |
Definition: Abstract. Options: N/A |
disk_directory |
String |
Definition: Attachment path. Options: N/A |
disk_file_name |
String |
Definition: Attachment name. Options: N/A |
file_name |
String |
Definition: Name of the file to be uploaded. Options: N/A |
issue_id |
Integer |
Definition: Work item ID. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: User ID. Value range: N/A |
name |
String |
Definition: Username with the tenant name: Tenant name_Username. Options: N/A |
nick_name |
String |
Definition: Alias. Options: N/A |
user_id |
String |
Definition: User UUID. Value range: N/A |
user_num_id |
Integer |
Definition: Digital ID of a user. Value range: N/A |
first_name |
String |
Definition: Username. Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Custom property name. Value range: N/A |
new_name |
String |
Definition: Custom property name. Value range: N/A |
value |
String |
Definition: Value of the custom property. Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Domain ID. The options are as follows: 14: performance 15: function 16: reliability 17: cyber security 18: maintainability 19: other design for X (DFX) 20: availability Options: 14, 15, 16, 17, 18, 19, and 20 |
name |
String |
Parameter description: Domain name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: Sprint ID. Options: Minimum value: 0. |
name |
String |
Parameter description: Sprint name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Module ID. Value range: Minimum value: 0. |
name |
String |
Parameter description: Module name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: Sequence ID. Options: Minimum value: 0. |
name |
String |
Definition: Sequence value. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Parent work item ID. Options: Minimum value: 0. |
name |
String |
Parameter description: Parent work item name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Priority ID. The options are as follows: 1: low 2: medium 3: high Options: 1, 2, and 3 |
name |
String |
Parameter description: Priority. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
project_id |
String |
Definition: Project ID. Value range: N/A |
project_name |
String |
Definition: Project name. Value range: N/A |
project_num_id |
Integer |
Definition: Digital ID of a project. Options: Minimum value: 0. |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Severity ID. The options are as follows: 10: critical 11: major 12: minor 13: info Options: 10, 11, 12, and 13 |
name |
String |
Definition: Severity. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Parameter description: Status ID. The options are as follows: 1: initial 2: in progress 3: solved 4: testing 5: closed 6: rejected Options: 1, 2, 3, 4, 5, and 6 |
name |
String |
Parameter description: Status name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: Story point ID. A story point is an agile method for estimating workloads. It can be regarded as the development cost, which takes into account the required efforts for story delivery, development complexity, and risks. Story point values corresponding to story point IDs: 1: 0 2: 1/2 3: 1 4: 2 5: 3 6: 5 7: 8 8: 13 9: 21 10: 40 11: 80 12: 100 Options: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 |
name |
String |
Definition: Story point name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: Type ID. The options are as follows: 2 (task) 3 (bug) 5 (epic) 6 (feature) 7 (story) Options: 2, 3, 5, 6, and 7 |
name |
String |
Parameter description: Type name. Options: N/A |
Parameter |
Type |
Description |
---|---|---|
custom_field |
String |
Parameter description: Custom field. You can obtain the custom_field value returned using the [Querying Custom Fields of a Scrum Work Item]ListIssueCustomFields.xml) API. Constraints: This field can be left blank. Options: N/A Default value: N/A |
field_name |
String |
Definition: Values of custom properties. Use commas (,) to separate multiple values, which can be obtained by querying the name value returned when calling the Querying Custom Fields of a Scrum Work Item API. Constraints: This field can be left blank. Value range: N/A Default value: N/A |
value |
String |
Definition: Values of custom properties. Use commas (,) to separate multiple values. You can obtain the value by querying the options value returned when calling the Querying Custom Fields of a Scrum Work Item API. Constraints: This field can be left blank. Value range: N/A Default value: N/A |
description |
String |
Definition: Custom field description. Options: N/A |
field_type |
String |
Definition: Custom field type. Options: textArea (multi-line text), text (single-line text), select (drop-down list), number (digit), time_date (date), checkbox (check box), and radio (radio button). Options: textArea, text, select, number, time_date, checkbox, and radio |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition: Security level code. Constraints: N/A Value range: N/A Default value: N/A |
name |
String |
Definition: Security level field name. Constraints: N/A Value range: N/A Default value: N/A |
sequence |
Integer |
Definition: Security level sorting value. A larger value indicates a higher security level. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
Description |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
Description |
Example Requests
GET https://{endpoint}/v4/projects/526cefde62004de2b62b5e8dd2c2b3af/issues/4568921
Example Responses
Status code: 200
OK
{ "actual_work_hours" : 0, "assigned_cc_user" : [ { "id" : 4091, "name" : "demo_user_name", "nick_name" : "bear1" } ], "assigned_user" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "bear1" }, "begin_time" : "2020-09-12", "created_time" : "2020-09-13 14:40:11", "creator" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "bear1" }, "custom_fields" : [ { "name" : "customField16", "value" : "value", "new_name" : "custom_field16" } ], "new_custom_fields" : [ { "custom_field" : "custom_field16", "field_name" : "bear1", "value" : "bear11,bear12", "field_type" : "textArea", "description" : "description" } ], "developer" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "bear1" }, "domain" : { "id" : 14, "name" : "Performance" }, "done_ratio" : 0, "end_time" : "2020-09-19", "expected_work_hours" : 9, "id" : 4567, "project" : { "project_id" : "526cefde62004de2b62b5e8dd2c2b3af", "project_name" : "testDemo", "project_num_id" : 78953 }, "iteration" : { "id" : 456, "name" : "iteeration1" }, "story_point" : { "id" : 3, "name" : "1" }, "module" : { "id" : 456, "name" : "Project" }, "name" : "issueDemo", "parent_issue" : { "id" : 123, "name" : "parentDemo" }, "priority" : { "id" : 1, "name" : "Low" }, "severity" : { "id" : 12, "name" : "Minor" }, "status" : { "id" : 1, "name" : "Initial" }, "tracker" : { "id" : 7, "name" : "story" }, "updated_time" : "2020-09-14 14:40:11", "closed_time" : "2020-09-15 14:40:11", "description" : "demo", "order" : { "id" : 1, "name" : "1" }, "accessories" : [ { "attachment_id" : 123444, "issue_id" : 123444, "creator_num_id" : 123444, "created_date" : "2021-12-15 15:57:16", "file_name" : "res.jpg", "container_type" : "issue", "disk_file_name" : "f0ef7216-fd05-40d4-8dea-6e6057739bb7.jpg", "digest" : 123444, "disk_directory" : 123444, "creator_id" : "a360371833bf4c558f796fd707b44daf" } ] }
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 ShowIssueV4Solution { 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(); ShowIssueV4Request request = new ShowIssueV4Request(); request.withProjectId("{project_id}"); request.withIssueId({issue_id}); try { ShowIssueV4Response response = client.showIssueV4(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 = ShowIssueV4Request() request.project_id = "{project_id}" request.issue_id = {issue_id} response = client.show_issue_v4(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 |
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 := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := projectman.NewProjectManClient( projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ShowIssueV4Request{} request.ProjectId = "{project_id}" request.IssueId = int32({issue_id}) response, err := client.ShowIssueV4(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 |
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