高级查询我的待办工作项
功能介绍
高级查询我的待办工作项
调用方法
请参见如何调用API。
URI
POST /v4/issues
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 必传。 取值范围: 最小长度:10,最大长度:32768。 默认取值: 不涉及。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
limit |
否 |
Integer |
参数解释: 每页显示数量。 约束限制: 最小值:1;最大值:100。 取值范围: 0-100. 默认取值: 不涉及。 |
offset |
否 |
Integer |
参数解释: 偏移量。 约束限制: offset是limit的整数倍,limit=10,offset=0,10,20... 取值范围: 不涉及。 默认取值: 不涉及。 |
subject |
否 |
String |
参数解释: 搜索关键词。 约束限制: 正则表达式:"[\S]{1,100}"。 取值范围: 不涉及。 默认取值: 不涉及。 |
created_on |
否 |
String |
参数解释: 工作项创建时间区间。 约束限制: 正则表达式:"([1-9][0-9]{0,12})?(,)?([1-9][0-9]{0,12})?"。 取值范围: 不涉及。 默认取值: 不涉及。 |
updated_on |
否 |
String |
参数解释: 工作项更新时间区间。 约束限制: 正则表达式:"([1-9][0-9]{0,12})?(,)?([1-9][0-9]{0,12})?"。 取值范围: 不涉及。 默认取值: 不涉及。 |
closed_on |
否 |
String |
参数解释: 工作项结束时间区间。 约束限制: 正则表达式:"([1-9][0-9]{0,12})?(,)?([1-9][0-9]{0,12})?"。 取值范围: 不涉及。 默认取值: 不涉及。 |
start_date |
否 |
String |
参数解释: 工作项预计开始日期区间。 约束限制: 正则表达式:"([1-9][0-9]{0,12})?(,)?([1-9][0-9]{0,12})?"。 取值范围: 不涉及。 默认取值: 不涉及。 |
due_date |
否 |
String |
参数解释: 工作项预计结束日期区间。 约束限制: 正则表达式:"([1-9][0-9]{0,12})?(,)?([1-9][0-9]{0,12})?|Empty"。 取值范围: 不涉及。 默认取值: 不涉及。 |
tracker_id |
否 |
String |
参数解释: 工作项类型。 约束限制: 正则表达式:"(\d)(,\d)*"。 取值范围: 工作项类型枚举: 2(任务/Task) 3(缺陷/Bug) 5(Epic) 6(Feature) 7(Story) 默认取值: 不涉及。 |
status_id |
否 |
String |
参数解释: 工作项状态。 约束限制: 正则表达式:"[\S]{1,64}"。 取值范围: 枚举: 1(新建) 2(进行中) 3(已解决) 4(测试中) 5( 已关闭) 6(已拒绝)。 默认取值: 不涉及。 |
author_id |
否 |
String |
参数解释: 工作项创建人id(用户数字id和用户uuid均支持)。通过[获取当前用户信息]接口查询用户id信息,返回数据的user_id为用户uuid,user_num_id为用户数字id。 约束限制: 正则表达式:"([1-9][0-9]{0,5})(,([1-9][0-9]{0,5}))*"。 取值范围: 不涉及。 默认取值: 不涉及。 |
developer_id |
否 |
String |
参数解释: 工作项开发人员id(用户数字id和用户uuid均支持)。通过[[获取当前用户信息]ShowCurUserInfo.xml)]接口查询用户id信息,返回数据的user_id为用户uuid,user_num_id为用户数字id。 约束限制: 正则表达式:"([1-9][0-9]{0,5})(,([1-9][0-9]{0,5}))*"。 取值范围: 不涉及。 默认取值: 不涉及。 |
priority_id |
否 |
String |
参数解释: 工作项优先级id。 约束限制: 正则表达式:"([0-9])(,[0-9])*"。 取值范围: 枚举: 1(低); 2(中); 3(高)。 默认取值: 不涉及。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
issue_list |
Array of issue_list objects |
参数解释: 工作项信息列表 |
total |
Integer |
参数解释: 工作项总数 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
actual_work_hours |
Double |
参数解释: 实际工时 约束限制: 不涉及 |
assigned_to |
SimpleUserIn object |
参数解释: 处理人 |
author |
SimpleUserIn object |
参数解释: 作者 |
closed_flag |
Integer |
参数解释: 关闭标志 取值范围: 不涉及 |
closeder |
SimpleUserIn object |
参数解释: 关闭人 |
created_on |
String |
参数解释: 工作项新建时间戳 取值范围: 不涉及 |
deleted |
Boolean |
参数解释: 是否删除工作项,true:删除;false:未删除。 取值范围: 不涉及 |
developer |
SimpleUserIn object |
参数解释: 开发人员 |
domain |
domain object |
参数解释: 领域信息 |
done_ratio |
Integer |
参数解释: 工作项完成度 取值范围: 不涉及 |
due_date |
String |
参数解释: 工作项预计结束时间戳 取值范围: 不涉及 |
expected_work_hours |
Double |
参数解释: 预计工时 取值范围: 不涉及 |
find_release_dev |
String |
参数解释: 发现发布版本 取值范围: 不涉及 |
id |
Integer |
参数解释: 工作项id 取值范围: 不涉及 |
is_watcher |
Boolean |
参数解释: 是否关注工作项,true:关注;false:不关注。 取值范围: 不涉及 |
module |
module object |
参数解释: 模块信息 |
order |
order object |
参数解释: 优先级顺序信息 |
parent_issue |
parent_issue object |
参数解释: 父工作项信息 |
parent_issue_id |
Integer |
参数解释: 父工作项id 取值范围: 不涉及 |
position |
Double |
参数解释: 排序数值 取值范围: 不涉及 |
priority |
priority object |
参数解释: 工作项优先级信息 |
project |
project object |
参数解释: 项目信息 |
release_dev |
String |
参数解释: 发布版本 取值范围: 不涉及 |
severity |
severity object |
参数解释: 重要程度信息 |
status |
status object |
参数解释: 工作项状态信息 |
subject |
String |
参数解释: 工作项标题 取值范围: 不涉及 |
tracker |
tracker object |
参数解释: 工作项类型信息 |
updated_on |
String |
参数解释: 工作项更新时间戳 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
Integer |
参数解释: 用户id 取值范围: 不涉及 |
identifier |
String |
参数解释: 用户uuid 取值范围: 不涉及 |
name |
String |
参数解释: 用户名称 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
Integer |
参数解释: 模块id 取值范围: 不涉及 |
name |
String |
参数解释: 模块名称 取值范围: 不涉及 |
path_name |
String |
参数解释: 模块路径名称 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
Integer |
参数解释: 项目id 取值范围: 不涉及 |
identifier |
String |
参数解释: 项目uuid 取值范围: 不涉及 |
name |
String |
参数解释: 项目名称 取值范围: 不涉及 |
type |
String |
参数解释: 项目类型 取值范围: 不涉及 |
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误描述 |
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误描述 |
请求示例
POST https://{endpoint}/v4/issues
{
"offset" : "0",
"limit" : "15",
"status_id" : "5",
"due_date" : "1682265600000,1682265600000"
}
响应示例
状态码:200
OK
{
"issue_list" : [ {
"id" : 7220820,
"subject" : "demo_issue",
"project" : {
"name" : "demo_project",
"id" : 30387805,
"identifier" : "",
"type" : "scrum"
},
"done_ratio" : 0,
"expected_work_hours" : 0,
"actual_work_hours" : 0,
"tracker" : {
"id" : 7,
"name" : "Story"
},
"order" : {
"id" : 1,
"name" : "1.0"
},
"severity" : {
"id" : 12,
"name" : "一般"
},
"priority" : {
"id" : 2,
"name" : "中"
},
"domain" : { },
"position" : 7220820,
"module" : { },
"assigned_to" : {
"id" : 4091,
"name" : ""
},
"author" : {
"id" : 4091,
"name" : ""
},
"developer" : { },
"closeder" : { },
"status" : {
"id" : 1,
"name" : "新建"
},
"is_watcher" : false,
"closed_flag" : 0,
"deleted" : false,
"created_on" : "1681783846000",
"updated_on" : "1681783846000",
"due_date" : "1684252800000"
} ],
"total" : 1
}
SDK代码示例
SDK代码示例如下。
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 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 SearchIssuesSolution {
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();
SearchIssuesRequest request = new SearchIssuesRequest();
ListWorkTableIssueRequestV4RequestBody body = new ListWorkTableIssueRequestV4RequestBody();
body.withStatusId("5");
body.withDueDate("1682265600000,1682265600000");
body.withLimit(15);
body.withOffset(0);
request.withBody(body);
try {
SearchIssuesResponse response = client.searchIssues(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 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 = SearchIssuesRequest()
request.body = ListWorkTableIssueRequestV4RequestBody(
status_id="5",
due_date="1682265600000,1682265600000",
limit=15,
offset=0
)
response = client.search_issues(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 |
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.SearchIssuesRequest{}
statusIdListWorkTableIssueRequestV4RequestBody:= "5"
dueDateListWorkTableIssueRequestV4RequestBody:= "1682265600000,1682265600000"
limitListWorkTableIssueRequestV4RequestBody:= int32(15)
offsetListWorkTableIssueRequestV4RequestBody:= int32(0)
request.Body = &model.ListWorkTableIssueRequestV4RequestBody{
StatusId: &statusIdListWorkTableIssueRequestV4RequestBody,
DueDate: &dueDateListWorkTableIssueRequestV4RequestBody,
Limit: &limitListWorkTableIssueRequestV4RequestBody,
Offset: &offsetListWorkTableIssueRequestV4RequestBody,
}
response, err := client.SearchIssues(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
错误码
请参见错误码。