获取工作项列表

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求语法

GET /organization/organizationId/listWorkitems?spaceType=String&spaceIdentifier=String&category=String&nextToken=String&maxResults=String&conditions=String&extraConditions=String&groupCondition=String&orderBy=String HTTP/1.1
Content-Type:application/json

请求参数

表 1. 请求Path参数
参数名称 类型 是否必选 示例 说明
organizationId String 5ebbc0228123212b59xxxxx

企业标识,也称企业id,字符串形式,可在云效访问链接中获取,如https://devops.aliyun.com/organization/【OrganizationId】

表 2. 请求Query参数
参数名称 类型 是否必选 示例 说明
spaceType String Project

资源类型

spaceIdentifier String 8fb83debd69a6c7c6626......

项目唯一标识id

category String Req

工作项大类型,需求为Req,缺陷为Bug,任务为Task,风险为Risk

nextToken String ""

分页中的起始序列,第一页默认为空

maxResults String 20

每页最大返回数量,0-200,默认值20

conditions String {"conditionGroups":[]}

过滤条件,可以参考页面上的工作项列表中请求workitem/list的搜索参数。

注意:里面的人员id,要为阿里云accountID,即账号ID

extraConditions String {"conditionGroups":[]}

额外条件,当该字段不为空时,conditions也不能为空

groupCondition String {"fieldIdentifier":"tag","className":"tag","format":"multiList","value":["c76e0e4bf64801cfad73......"],"operator":"EQUALS"}

分组条件,可以参考页面上的工作项列表中请求workitem/list的搜索参数。

注意:里面的人员id,要为阿里云accountID,即账号ID

orderBy String {"fieldIdentifier":"status","format":"list","order":"desc","className":"status"}

排序顺序,可以参考页面上的工作项列表中请求workitem/list的搜索参数。

注意:里面的人员id,要为阿里云accountID,即账号ID

searchType String LIST

搜索类型,默认是LIST,还可支持树形TREE等类型,具体更多参见页面请求的参数。

响应体语法

HTTP/1.1 200 OK
Content-Type:application/json

{
  "totalCount" : Long,
  "nextToken" : "String",
  "maxResults" : Long,
  "requestId" : "String",
  "errorMsg" : "String",
  "errorCode" : "String",
  "success" : Boolean,
  "workitems" : [ {
    "identifier" : "String",
    "subject" : "String",
    "document" : "String",
    "assignedTo" : "String",
    "status" : "String",
    "statusStageIdentifier" : "String",
    "spaceIdentifier" : "String",
    "spaceName" : "String",
    "spaceType" : "String",
    "logicalStatus" : "String",
    "categoryIdentifier" : "String",
    "parentIdentifier" : "String",
    "workitemTypeIdentifier" : "String",
    "updateStatusAt" : Long,
    "serialNumber" : "String",
    "gmtCreate" : Long,
    "gmtModified" : Long,
    "creator" : "String",
    "modifier" : "String",
    "statusIdentifier" : "String"
  } ]
}

响应参数

表 3. 响应Body参数
参数名称 类型 示例 说明
totalCount Long 10

总数

nextToken String ""

分页Token,没有下一页则为空

maxResults Long 20

每页数量

requestId String ASSDS-ASSASX-XSAXSA-XSAXSAXS

请求id,每次请求都是唯一值,便于后续排查问题

errorMsg String error

错误信息

errorCode String Openapi.RequestError

错误码

success Boolean true

true或者false

workitems Array of workitem

工作项信息

identifier String e8bxxxxxxxxxxxxxxxx23

工作项唯一标识

subject String 测试工作项

工作项标题

document String html格式

工作项内容

assignedTo String 19xx7043xxxxxxx914

负责人的阿里云accountID

status String 待处理

状态名称

statusStageIdentifier String 1

状态阶段id

spaceIdentifier String e8b26xxxxx6e76aa20xxxxx23

所属项目id

spaceName String 需求项目

所属项目名称

spaceType String Project

项目类型

logicalStatus String NORMAL

逻辑状态

categoryIdentifier String Req

工作项的类型id

parentIdentifier String e8bxxxxxxxxxxxxxxxx24

父工作项id

workitemTypeIdentifier String 9uxxxxxxre573f5xxxxxx0

工作项类型id

updateStatusAt Long 1640850328000

状态更新时间

serialNumber String ABCD-1

编号

gmtCreate Long 1640850318000

创建时间的时间戳,单位毫秒

gmtModified Long 1640850318000

修改时间的时间戳,单位毫秒

creator String 19xx7043xxxxxxx914

创建人的阿里云accountID

modifier String 19xx7043xxxxxxx914

修改人的阿里云accountID

statusIdentifier String 100005

状态唯一标识

sprintIdentifier String 75528f17703e92e5a568......

迭代id

示例1

GET /organization/5ebbc0228123212b59xxxxx/listWorkitems?spaceType=Project&spaceIdentifier=8fb83debd69a6c7c6626......&category=Req&nextToken=""&maxResults=20&conditions={"conditionGroups":[]}&extraConditions={"conditionGroups":[]}&groupCondition={"fieldIdentifier":"tag","className":"tag","format":"multiList","value":["c76e0e4bf64801cfad73......"],"operator":"EQUALS"}&orderBy={"fieldIdentifier":"status","format":"list","order":"desc","className":"status"} HTTP/1.1
Host:devops.aliyuncs.com
Content-Type:application/json

正常返回示例

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "workitems" : [ {
    "identifier" : "5daa9a15c7fd55523996......",
    "statusStageIdentifier" : "7",
    "gmtModified" : 1645010729000,
    "creator" : "1967043931......",
    "spaceType" : "Project",
    "subject" : "111000111",
    "document" : "123455",
    "modifier" : "1967043931......",
    "spaceIdentifier" : "8fb83debd69a6c7c6626......",
    "parentIdentifier" : "EMPTY_VALUE",
    "workitemTypeIdentifier" : "9uy29901re573f561d......",
    "categoryIdentifier" : "Req",
    "gmtCreate" : 1644896556000,
    "assignedTo" : "1967043931......",
    "spaceName" : "111122222233",
    "logicalStatus" : "NORMAL",
    "updateStatusAt" : 1645005060000,
    "statusIdentifier" : "156603",
    "status" : "设计中",
    "serialNumber" : "ABCD-1",
    "sprintIdentifier" : "75528f17703e92e5a568......"
  }, {
    "identifier" : "6e9c9d3937da9764c1de......",
    "statusStageIdentifier" : "11",
    "gmtModified" : 1644572567000,
    "creator" : "1967043931......",
    "spaceType" : "Project",
    "subject" : "openapi00021000",
    "document" : "11111",
    "modifier" : "1967043931......",
    "spaceIdentifier" : "8fb83debd69a6c7c6626......",
    "parentIdentifier" : "EMPTY_VALUE",
    "workitemTypeIdentifier" : "9uy29901re573f561d......",
    "categoryIdentifier" : "Req",
    "gmtCreate" : 1644572228000,
    "assignedTo" : "1967043931......",
    "spaceName" : "111122222233",
    "logicalStatus" : "NORMAL",
    "updateStatusAt" : 1644572494000,
    "statusIdentifier" : "142838",
    "status" : "开发中",
    "serialNumber" : "ABCD-2",
    "sprintIdentifier" : "75528f17703e92e5a568......"
  }, {
    "identifier" : "6fc04b35d8cb62128b5524a3c5",
    "statusStageIdentifier" : "1",
    "gmtModified" : 1644572109000,
    "creator" : "1967043931......",
    "spaceType" : "Project",
    "subject" : "rrqwfqw",
    "document" : "<p style=\"text-align: left;text-indent: 0;margin-left: 0;\"><span></span></p>",
    "modifier" : "1967043931......",
    "spaceIdentifier" : "8fb83debd69a6c7c6626......",
    "parentIdentifier" : "EMPTY_VALUE",
    "workitemTypeIdentifier" : "9uy29901re573f561d......",
    "categoryIdentifier" : "Req",
    "gmtCreate" : 1644572108553,
    "assignedTo" : "1967043931......",
    "spaceName" : "111122222233",
    "logicalStatus" : "NORMAL",
    "statusIdentifier" : "100005",
    "status" : "待处理",
    "serialNumber" : "ABCD-3",
    "sprintIdentifier" : "75528f17703e92e5a568......"
  } ],
  "nextToken" : "",
  "maxResults" : 20,
  "success" : true,
  "errorCode" : "",
  "totalCount" : 3,
  "errorMsg" : ""
}

错误码

HttpCode 错误码 错误信息 描述
400 Openapi.RequestError request error OpenAPI请求数据错误
403 Operate.NoPermission NoPermission 没有权限

访问错误中心查看更多错误码。

开发者资源

  • SDK

    阿里云为您提供多种语言的SDK,帮助您快速通过API集成阿里云的产品和服务,推荐您使用SDK调用API,已免除您手动签名验证。

  • OpenAPI Explorer

    快速检索,可视化调试API,在线命令行工具,同步动态生成可执行的SDK代码示例。

  • 阿里云CLI

    阿里云资产管理和配置工具,可通过命令方式同时管理多个阿里云产品和服务,简单快捷,是您上云好帮手。