获取工作项所有字段

调试

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

请求语法

GET /organization/organizationId/workitems/fields/listAll?spaceType=String&spaceIdentifier=String&workitemTypeIdentifier=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 e8bxxxxxxxxxxxxxxxx23

项目唯一标识id

workitemTypeIdentifier String dfexxxxxf4fee18xxxxx36

工作项类型id,工作项类型的列表和id可以从ListProjectWorkitemType中获取

响应体语法

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

{
  "requestId" : "String",
  "errorMsg" : "String",
  "errorCode" : "String",
  "success" : Boolean,
  "fields" : [ {
    "creator" : "String",
    "description" : "String",
    "gmtCreate" : Long,
    "gmtModified" : Long,
    "type" : "String",
    "identifier" : "String",
    "modifier" : "String",
    "name" : "String",
    "format" : "String",
    "className" : "String",
    "resourceType" : "String",
    "defaultValue" : "String",
    "isRequired" : Boolean,
    "isSystemRequired" : Boolean,
    "linkWithService" : "String",
    "isShowWhenCreate" : Boolean,
    "options" : [ {
      "identifier" : "String",
      "fieldIdentifier" : "String",
      "value" : "String",
      "valueEn" : "String",
      "displayValue" : "String",
      "position" : Long,
      "level" : Long
    } ]
  } ]
}

响应参数

表 3. 响应Body参数
参数名称 类型 示例 说明
requestId String ASSDS-ASSASX-XSAXSA-XSAXSAXS

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

errorMsg String error

错误信息

errorCode String Openapi.RequestError

错误码

success Boolean true

true或者false

fields Array of field

字段信息

creator String 19xx7043xxxxxxx914

创建人阿里云accountId

description String 字段的具体信息

描述信息

gmtCreate Long 1623916393000

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

gmtModified Long 1623916393000

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

type String NativeField

区分不同的类型,如系统字段: NativeField、用户自定义字段CustomField

identifier String e8bxxxxxxxxxxxxxxxx23

字段唯一标识符

modifier String 19xx7043xxxxxxx914

修改人阿里云accountId

name String 负责人

字段名称

format String list

字段格式

className String 例:date

字段类型

resourceType String 例:Workitem

区分不同的适用对象

defaultValue String 123

默认值

isRequired Boolean false

是否必填

isSystemRequired Boolean false

是否是系统必须字段,比如:负责人、状态等。

linkWithService String null

联动的服务,比如迭代,迭代服务开启/关闭,这个字段加进/剔除出对应的模板; 字段模板里,这类字段不能手动添加或删除

isShowWhenCreate Boolean false

创建时是否展示

options Array of option

待选值

identifier String 重复的缺陷

待选值的唯一标识

fieldIdentifier String e8bxxxxxxxxxxxxxxxx23

字段唯一标识

value String 重复的缺陷

待选值中文名称

valueEn String null

待选值英文名称

displayValue String 重复的缺陷

根据语言环境获取当前展示的值

position Long 1

待选值顺序

level Long 1

展示级别,数字范围1~9,数字越大,颜色越浅。

参数

GET /organization/5ebbc0228123212b59xxxxx/workitems/fields/listAll?spaceType=Project&spaceIdentifier=e8bxxxxxxxxxxxxxxxx23&workitemTypeIdentifier=dfexxxxxf4fee18xxxxx36 HTTP/1.1
Host:devops.aliyuncs.com
Content-Type:application/json

正常返回示例

JSON格式

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

{
  "requestId" : "FBB81FD1-49C3-539B-A1C5-F83530......",
  "success" : true,
  "errorCode" : "",
  "fields" : [ {
    "identifier" : "subject",
    "isRequired" : true,
    "name" : "标题",
    "format" : "input",
    "description" : "标题不能为空",
    "className" : "string",
    "type" : "NativeField"
  }, {
    "identifier" : "description",
    "isRequired" : false,
    "name" : "描述",
    "format" : "input",
    "className" : "string",
    "type" : "NativeField"
  }, {
    "identifier" : "workitemType",
    "isRequired" : false,
    "creator" : "AK-ADMIN",
    "gmtModified" : 1643355101000,
    "modifier" : "AK-ADMIN",
    "format" : "list",
    "description" : "工作项类型",
    "isSystemRequired" : true,
    "className" : "workitemType",
    "gmtCreate" : 1643355101000,
    "type" : "NativeField",
    "isShowWhenCreate" : true,
    "name" : "工作项类型",
    "resourceType" : "Workitem"
  }, {
    "identifier" : "status",
    "isRequired" : false,
    "creator" : "AK-ADMIN",
    "gmtModified" : 1643355101000,
    "modifier" : "AK-ADMIN",
    "format" : "list",
    "description" : "状态",
    "isSystemRequired" : true,
    "className" : "status",
    "gmtCreate" : 1643355101000,
    "type" : "NativeField",
    "isShowWhenCreate" : true,
    "name" : "状态",
    "resourceType" : "Workitem"
  }, {
    "identifier" : "assignedTo",
    "isRequired" : true,
    "creator" : "AK-ADMIN",
    "gmtModified" : 1643355101000,
    "modifier" : "AK-ADMIN",
    "format" : "list",
    "description" : "负责人",
    "isSystemRequired" : true,
    "className" : "user",
    "gmtCreate" : 1643355101000,
    "type" : "NativeField",
    "isShowWhenCreate" : true,
    "name" : "负责人",
    "resourceType" : "Workitem"
  }, {
    "identifier" : "workitem.verifier",
    "creator" : "AK-ADMIN",
    "gmtModified" : 1643355101000,
    "modifier" : "AK-ADMIN",
    "format" : "list",
    "description" : "验证者",
    "isSystemRequired" : true,
    "className" : "user",
    "gmtCreate" : 1643355101000,
    "type" : "Role",
    "isShowWhenCreate" : true,
    "name" : "验证者",
    "resourceType" : "Workitem"
  }, {
    "identifier" : "priority",
    "isRequired" : true,
    "creator" : "AK-ADMIN",
    "gmtModified" : 1643355101000,
    "defaultValue" : "77c7fb03c4186c8691d6......",
    "modifier" : "AK-ADMIN",
    "format" : "list",
    "description" : "",
    "isSystemRequired" : true,
    "className" : "option",
    "gmtCreate" : 1643355101000,
    "type" : "SystemCustomField",
    "isShowWhenCreate" : true,
    "name" : "优先级",
    "options" : [ {
      "displayValue" : "紧急",
      "identifier" : "ec6b0daec1334292f636......",
      "fieldIdentifier" : "priority",
      "valueEn" : "Urgent",
      "level" : 0,
      "position" : 1,
      "value" : "紧急"
    }, {
      "displayValue" : "高",
      "identifier" : "0ff8f91ced4ee913da7c......",
      "fieldIdentifier" : "priority",
      "valueEn" : "High",
      "level" : 1,
      "position" : 2,
      "value" : "高"
    }, {
      "displayValue" : "中",
      "identifier" : "77c7fb03c4186c8691d6......",
      "fieldIdentifier" : "priority",
      "valueEn" : "Medium",
      "level" : 4,
      "position" : 3,
      "value" : "中"
    }, {
      "displayValue" : "低",
      "identifier" : "39a7dc21e2552dff2304......",
      "fieldIdentifier" : "priority",
      "valueEn" : "Low",
      "level" : 9,
      "position" : 4,
      "value" : "低"
    } ],
    "resourceType" : "Workitem"
  } ],
  "errorMsg" : ""
}

错误码

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

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

开发者资源

  • SDK

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

  • OpenAPI Explorer

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

  • 阿里云CLI

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