CreateWorkitem - 创建工作项

创建工作项。

调试

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

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
organizationIdstring

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

5ebbc0228123212b59xxxxx
bodyobject

请求结构。

subjectstring

工作项标题

测试工作项
descriptionstring

工作项内容

测试内容
descriptionFormatstring

内容格式,目前只支持RICHTEXT格式

RICHTEXT
assignedTostring

工作项负责人的id,或者企业中的用户名

19xxxx31947xxxx
spacestring

项目ID唯一标识,同projectId

asd345xxxxx9q9845xxxxx34
spaceIdentifierstring

同space字段,项目ID唯一标识

asd345xxxxx9q9845xxxxx34
spaceTypestring

资源类型

Project
categorystring

工作项的类型id,比如:Bug、Task对应id

Req
workitemTypestring

工作项小类型id

9uyxxxxxre573f561dxxn40
fieldValueListarray

自定义字段

object

需要先通过获取工作项字段的接口:ListWorkItemAllFields 查看哪些字段是必填,isRequired为true的则为必填。 【优先级】,虽然是自定义字段,但是必填

fieldIdentifierstring

字段唯一标识,优先级字段必填

6aexxxxxa1d98c09c60xxxx16
valuestring

字段值,写入时使用。优先级字段必填

77c7fb03c4186c8691d6...
workitemIdentifierstring

工作项的唯一标识,暂用不到

null
sprintarray

要关联迭代

string

迭代唯一标识id

81be62xxxxxb63e291bdcxxxxa4
trackerarray

抄送人account id

string

抄送人account id

1561159309......
participantarray

参与人account id

string

参与人account id

1561159309......
verifierarray

验证者的account id

string

验证者的account id

1561159309......
parentstring

父项工作项唯一标识

3a0c9cdd24ae1e1995b8...

返回参数

名称类型描述示例值
object
requestIdstring

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

ASSDS-ASSASX-XSAXSA-XSAXSAXS
errorMsgstring

错误信息

error
errorCodestring

错误码

Openapi.RequestError
successboolean

true或者false

true
workitemobject

工作项信息

identifierstring

工作项唯一标识

e8bxxxxxxxxxxxxxxxx23
subjectstring

工作项标题

测试工作项
documentstring

工作项内容

html格式
assignedTostring

负责人的阿里云accountId

19xx7043xxxxxxx914
statusstring

状态名称

待处理
statusStageIdentifierstring

状态阶段id

100005
spaceIdentifierstring

所属项目id

e8b26xxxxx6e76aa20xxxxx23
spaceNamestring

所属项目名称

需求项目
spaceTypestring

项目类型

Project
logicalStatusstring

逻辑状态

NORMAL
categoryIdentifierstring

工作项的类型id

Req
parentIdentifierstring

父工作项id

e8bxxxxxxxxxxxxxxxx24
workitemTypeIdentifierstring

工作项类型id

9uxxxxxxre573f5xxxxxx0
updateStatusAtlong

状态更新时间

1640850328000
serialNumberstring

编号

ABCD-1
gmtCreatelong

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

1640850318000
gmtModifiedlong

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

1640850318000
creatorstring

创建人的阿里云accountId

19xx7043xxxxxxx914
modifierstring

修改人的阿里云accountId

19xx7043xxxxxxx914
statusIdentifierstring

状态唯一标识id

28
sprintIdentifierstring

迭代的唯一标识id

75528f17703e92e5a568......

示例

正常返回示例

JSON格式

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "errorMsg": "error",
  "errorCode": "Openapi.RequestError",
  "success": true,
  "workitem": {
    "identifier": "e8bxxxxxxxxxxxxxxxx23",
    "subject": "测试工作项",
    "document": "html格式",
    "assignedTo": "19xx7043xxxxxxx914",
    "status": "待处理",
    "statusStageIdentifier": "100005",
    "spaceIdentifier": "e8b26xxxxx6e76aa20xxxxx23",
    "spaceName": "需求项目",
    "spaceType": "Project",
    "logicalStatus": "NORMAL",
    "categoryIdentifier": "Req",
    "parentIdentifier": "e8bxxxxxxxxxxxxxxxx24",
    "workitemTypeIdentifier": "9uxxxxxxre573f5xxxxxx0",
    "updateStatusAt": 1640850328000,
    "serialNumber": "ABCD-1",
    "gmtCreate": 1640850318000,
    "gmtModified": 1640850318000,
    "creator": "19xx7043xxxxxxx914",
    "modifier": "19xx7043xxxxxxx914",
    "statusIdentifier": "28",
    "sprintIdentifier": "75528f17703e92e5a568......"
  }
}

错误码

HTTP status code错误码错误信息描述
400Openapi.RequestErrorrequest errorOpenAPI请求数据错误
403Operate.NoPermissionNoPermission没有权限

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

变更历史

变更时间变更内容概要操作
2022-12-05OpenAPI 错误码发生变更
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
阿里云首页 云效 相关技术圈