Querying Work Items of a Project
Function
Work item type ID, which is a pagination parameter. This API is used to query project work items by work item ID, pagination parameter, and creation time.
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
GET /v4/projects/{project_id}/issues
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition A 32-character UUID. It uniquely identifies a project. Obtain a project ID by calling the API for querying projects. The value of project_id in the response message body is a project ID. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Definition Start page number. The value starts from 0 and is an integer multiple of limit. Constraints The value is a string of 0 to 11 digits. If the first digit is 0, the value can only be 0. If the first digit ranges from 1 to 9, the value can contain a maximum of 11 digits. Range Min.: 0. Default Value 0 |
| limit | No | Integer | Definition Page size (1 to 100). Constraints N/A Range 1–100 Default Value 100 |
| tracker_id | No | Integer | Definition: Work item type. Constraints: Work item type options are as follows: 2 (task) 3 (bug) 5 (epic) 6 (feature) 7 (story) Options: Minimum value: 2. Maximum value: 7. Default value: N/A |
| created_time_interval | No | String | Definition Work item creation duration (start and end time). Constraints The two 13-digit timestamps are separated by a comma (,). The timestamps are accurate to milliseconds. Range N/A Default Value N/A |
| updated_time_interval | No | String | Definition Work item update duration (start and end time). Constraints A string of 1 to 13 digits. The first digit ranges from 1 to 9. Use commas (,) to separate values. Range N/A Default Value N/A |
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 The value contains 10 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| issues | Array of IssueItemSfV4 objects | Definition: Work item list information. |
| total | Integer | Definition: Total number of work items. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition Work item ID. Range N/A |
| actual_work_hours | Double | Definition: Actual workloads. Options: N/A |
| assigned_user | IssueUser object | Definition Handler. Range N/A |
| author | IssueUser object | Definition: Author. |
| begin_time | Long | Definition: Start time of a work item. Options: N/A |
| closed_time | Long | Definition: Time when a work item was closed. Options: N/A |
| created_time | Long | Definition: Creation time. Options: N/A |
| custom_feilds | Array of CustomFeildRecord objects | Definition: Custom property. |
| developer | IssueUser object | Definition: Developer. |
| discover_version | String | Definition: Version where the bug was found. Options: N/A |
| domain | domain object | Definition: ID: Domain. 14: performance 15: function 16: reliability 17: cyber security 18: maintainability 19: other design for X (DFX) 20: availability |
| done_ratio | Integer | Definition: Work item progress value. Options: N/A |
| end_time | Long | Definition: End time of a work item. Options: N/A |
| expected_work_hours | Double | Definition: Estimated workloads. Options: N/A |
| iteration | iteration object | Definition: Sprint. |
| module | module object | Definition: Module. |
| order | Integer | Definition Priority order. Range 1–100 |
| parent_issue_id | Integer | Definition Parent work item ID. Range N/A |
| priority | priority object | Definition: Work item priority. |
| release_version | String | Definition: Release version. Options: N/A |
| root_issue_id | Integer | Definition Root work item ID. Range N/A |
| severity | severity object | Definition: Work item severity. |
| status | status object | Definition: Work item status. |
| story_point | story_point object | Definition: Story point ID. 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 13: ∞ 14: ? |
| subject | String | Definition: Work item title. Options: N/A |
| tracker | tracker object | Definition: Work item type. 2 (task) 3 (bug) 5 (epic) 6 (feature) 7 (story) |
| updated_time | Long | Definition: Work item update time. Options: N/A |
| env | IssueAttribute object | Definition Environment. Range N/A |
| find_release_dev | String | Definition Version number. Range N/A |
| release_dev | String | Definition Release version number. Range N/A |
| tag_list | Array of TagRelation objects | Definition Tag list. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition: Custom work item property Options: N/A |
| name | String | Definition: Custom work item name. Options: N/A |
| value | String | Definition: Custom work item value. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition User ID. Range N/A |
| name | String | Definition Username. Range N/A |
| nick_name | String | Definition: Alias. Options: N/A |
| user_id | String | Definition User UUID. Range N/A |
| user_num_id | Integer | Definition Digital ID of a user. Range N/A |
| first_name | String | Definition: Username. Value range: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Domain ID. Options: N/A |
| name | String | Definition: Domain. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition Sprint ID. Range N/A |
| name | String | Definition: Sprint name. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition Module ID. Range N/A |
| name | String | Definition: Module. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Priority ID. Options: N/A |
| name | String | Definition: Priority. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Severity ID. Options: N/A |
| name | String | Definition: Severity. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Status ID. Options: N/A |
| name | String | Definition: Status name. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Story point ID. Options: N/A |
| name | String | Definition: Story point. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition: Type ID. Options: N/A |
| name | String | Definition: Type name. Options: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition Environment ID. Range N/A |
| name | String | Definition Environment name. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| relationId | Integer | Definition Association ID. Range N/A |
| tagId | Integer | Definition Tag ID. Range N/A |
| region | String | Definition Region. Range N/A |
| name | String | Definition Tag name. Range N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error description. Value range: N/A |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error description. Value range: N/A |
| request_id | String | Definition Request ID, which is automatically generated by the system. Range N/A |
Example Requests
GET https://{endpoint}/v4/projects/526cefde62004de2b62b5e8dd2c2b3af/issues Example Responses
Status code: 200
{
"total" : 1,
"issues" : [ {
"id" : 1377841,
"subject" : "testAPI",
"security_level" : null,
"release_version" : "",
"developer" : {
"user_id" : "d3775f2d201f423f9eeaa0b06f8f1b8f",
"user_num_id" : 83,
"nick_name" : "creq_chm1",
"name" : "creq_chm1"
},
"assigned_user" : {
"user_id" : "d3775f2d201f423f9eeaa0b06f8f1b8f",
"user_num_id" : 83,
"nick_name" : "creq_chm1",
"name" : "creq_chm1"
},
"author" : {
"user_id" : "d3775f2d201f423f9eeaa0b06f8f1b8f",
"user_num_id" : 83,
"nick_name" : "creq_chm1",
"name" : "creq_chm1"
},
"discover_version" : "",
"iteration" : null,
"story_point" : null,
"status" : {
"id" : 1,
"name" : "Initial"
},
"module" : null,
"priority" : {
"id" : 2,
"name" : "Medium"
},
"severity" : {
"id" : 12,
"name" : "Minor"
},
"domain" : null,
"tracker" : {
"id" : 3,
"name" : "Bug"
},
"updated_time" : 1782809865000,
"created_time" : 1782809865000,
"begin_time" : 1765900800000,
"end_time" : 1767110400000,
"closed_time" : null,
"order" : 1,
"parent_issue_id" : 1377839,
"root_issue_id" : 1377837,
"expected_work_hours" : 0,
"actual_work_hours" : 0,
"done_ratio" : 0,
"env" : null,
"custom_feilds" : [ ]
} ]
} 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 | 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 ListIssuesSfV4Solution { 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(); ListIssuesSfV4Request request = new ListIssuesSfV4Request(); request.withProjectId("{project_id}"); try { ListIssuesSfV4Response response = client.listIssuesSfV4(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 | # 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 = ListIssuesSfV4Request() request.project_id = "{project_id}" response = client.list_issues_sf_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 38 39 40 41 42 43 44 45 46 47 48 | 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.ListIssuesSfV4Request{} request.ProjectId = "{project_id}" response, err := client.ListIssuesSfV4(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.
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