Skip to content

用户需求 (requirement) ​

用户需求管理,支持获取用户需求列表,支持获取产品下的用户需求、创建用户需求、获取用户需求详情、修改用户需求、删除用户需求、激活用户需求、变更用户需求、关闭用户需求

动作概览 ​

SDK 动作说明方法路径
list获取用户需求列表,支持获取产品下的用户需求GET/products/{productID}/requirements
create创建用户需求POST/requirements
get获取用户需求详情GET/requirements/{storyID}
update修改用户需求PUT/requirements/{storyID}
delete删除用户需求DELETE/requirements/{storyID}
activate激活用户需求PUT/requirements/{storyID}/activate
change变更用户需求PUT/requirements/{storyID}/change
close关闭用户需求PUT/requirements/{storyID}/close

获取用户需求列表,支持获取产品下的用户需求 ​

  • SDK 调用:request("requirement/list", params)
  • HTTP:GET /products/{productID}/requirements
  • 动作类型:list
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
productID所属产品ID

查询参数 ​

参数类型必填默认值说明
browseTypestring否unclosed状态,默认是unclosed
allstory 全部
assignedtome 指派给我
openedbyme 我创建
reviewbyme 待我评审
draftstory 草稿
orderBystring否排序
id_asc ID 升序
id_desc ID 降序
title_asc 标题 升序
title_desc 标题 降序
status_asc 状态 升序
status_desc 状态 降序
recPerPagenumber否每页数量,不超过1000
pageIDnumber否页码,从第1页开始
filtersarray否搜索条件数组,每项包含 field/operator/value/join/group;field 必须是该接口支持的搜索字段,operator 使用该接口搜索配置支持的操作符。支持搜索字段:title(需求名称,示例:关键字);id(编号,示例:1);keywords(关键词,示例:关键字);status(当前状态,枚举:draft 草稿 | reviewing 评审中 | active 激活 | changing 变更中 | closed 已关闭);pri(优先级,枚举:1 | 2 | 3 | 4);module(所属模块,示例:all);stage(所处阶段,枚举:wait 未开始 | planned 已计划 | projected 研发立项 | designing 设计中 | designed 设计完毕 | developing 研发中 | developed 研发完毕 | testing 测试中 | tested 测试完毕 | verified 已验收 | rejected 验收失败 | delivering 交付中 | delivered 已交付 | released 已发布 | closed 已关闭);product(所属产品,示例:all);branch(branch,示例:all);grade(需求层级,示例:all);plan(所属计划,示例:all);estimate(预计小时,示例:关键字);source(来源,枚举:customer 客户 | user 用户 | po 产品经理 | market 市场 | service 客服 | operation 运营 | support 技术支持 | competitor 竞争对手 | partner 合作伙伴 | dev 开发人员 | tester 测试人员 | bug Bug | forum 论坛 | other 其他);sourceNote(来源备注,示例:关键字);fromBug(来源Bug,示例:关键字);category(类别,枚举:feature 功能 | interface 接口 | performance 性能 | safe 安全 | experience 体验 | improve 改进 | other 其他);openedBy(由谁创建,用户,示例:admin);reviewedBy(已评审人,用户,示例:admin);result(评审结果,枚举:pass 确认通过 | revert 撤销变更 | clarify 有待明确 | reject 拒绝);assignedTo(指派给,用户,示例:admin);closedBy(由谁关闭,用户,示例:admin);lastEditedBy(最后修改,用户,示例:admin);mailto(抄送给,用户,示例:admin);closedReason(关闭原因,枚举:done 已完成 | subdivided 已拆分 | duplicate 重复 | postponed 延期 | willnotdo 不做 | cancel 已取消 | bydesign 设计如此);version(版本号,示例:关键字);openedDate(创建日期,示例:2026-01-01);reviewedDate(评审时间,示例:2026-01-01);assignedDate(指派日期,示例:2026-01-01);closedDate(关闭日期,示例:2026-01-01);lastEditedDate(最后修改日期,示例:2026-01-01);activatedDate(激活日期,示例:2026-01-01)
groupJoinstring否条件组之间的连接方式
and and
or or

请求体 ​

无请求体。

返回值 ​

  • 返回形态:list
  • 结果字段:requirements
  • 分页字段:pager

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/list", {
  "productID": 1,
  "browseType": "unclosed",
  "orderBy": "id_asc",
  "recPerPage": 1,
  "pageID": 1,
  "filters": "<string>",
  "groupJoin": "and"
});

创建用户需求 ​

  • SDK 调用:request("requirement/create", params)
  • HTTP:POST /requirements
  • 动作类型:create
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

无路径参数。

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "productID": {
      "type": "integer",
      "description": "产品ID",
      "format": "int32"
    },
    "title": {
      "type": "string"
    },
    "pri": {
      "type": "integer",
      "description": "优先级,默认是3",
      "format": "int32"
    },
    "module": {
      "type": "integer",
      "description": "所属模块",
      "format": "int32"
    },
    "parent": {
      "type": "integer",
      "description": "父用户需求",
      "format": "int32"
    },
    "estimate": {
      "type": "number",
      "description": "预计工时",
      "format": "float"
    },
    "spec": {
      "type": "string",
      "description": "用户需求描述"
    },
    "category": {
      "type": "integer",
      "description": "类别(feature 功能 | interface 接口 | performance 性能 | safe 安全 | experience 体验 | improve 改进 | other 其他)",
      "format": "int32"
    },
    "source": {
      "type": "string",
      "description": "来源(customer 客户 | user 用户 | po 产品经理 | market 市场 | service 客服 | operation 运营 | support 技术支持 | competitor 竞争对手 | partner 合作伙伴 | dev 开发人员 | tester 测试人员 | bug Bug | forum 论坛 | other 其他)"
    },
    "verify": {
      "type": "string",
      "description": "验收标准"
    },
    "assignedTo": {
      "type": "string",
      "description": "指派给"
    },
    "reviewer": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "评审人员,如果无需评审则不传"
    }
  },
  "required": [
    "productID",
    "title"
  ]
}

示例:

json
{
  "productID": 1,
  "title": "智能头枕的颈椎保护",
  "pri": 3,
  "module": 0,
  "parent": 0,
  "estimate": 1,
  "category": "feature",
  "source": "customer",
  "assignedTo": "admin",
  "reviewer": [
    "productManager"
  ]
}

返回值 ​

  • 返回形态:object

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/create", {
  "productID": 1,
  "title": "<string>",
  "pri": 1,
  "module": 1,
  "parent": 1,
  "estimate": 1,
  "spec": "<string>",
  "category": 1,
  "source": "<string>",
  "verify": "<string>",
  "assignedTo": "<string>",
  "reviewer": [
    "<string>"
  ]
});

获取用户需求详情 ​

  • SDK 调用:request("requirement/get", params)
  • HTTP:GET /requirements/{storyID}
  • 动作类型:get
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

无请求体。

返回值 ​

  • 返回形态:object
  • 结果字段:requirement

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/get", {
  "storyID": 1
});

修改用户需求 ​

  • SDK 调用:request("requirement/update", params)
  • HTTP:PUT /requirements/{storyID}
  • 动作类型:update
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "pri": {
      "type": "integer",
      "description": "优先级,默认是3",
      "format": "int32"
    },
    "module": {
      "type": "integer",
      "description": "所属模块",
      "format": "int32"
    },
    "parent": {
      "type": "integer",
      "description": "父用户需求",
      "format": "int32"
    },
    "estimate": {
      "type": "number",
      "description": "预计工时",
      "format": "float"
    },
    "category": {
      "type": "integer",
      "description": "类别(feature 功能 | interface 接口 | performance 性能 | safe 安全 | experience 体验 | improve 改进 | other 其他)",
      "format": "int32"
    },
    "source": {
      "type": "string",
      "description": "来源(customer 客户 | user 用户 | po 产品经理 | market 市场 | service 客服 | operation 运营 | support 技术支持 | competitor 竞争对手 | partner 合作伙伴 | dev 开发人员 | tester 测试人员 | bug Bug | forum 论坛 | other 其他)"
    },
    "assignedTo": {
      "type": "string",
      "description": "指派给"
    }
  },
  "required": [
    "title"
  ]
}

示例:

json
{
  "title": "智能头枕的颈椎保护",
  "pri": 3,
  "module": 0,
  "parent": 0,
  "estimate": 1,
  "category": "feature",
  "source": "customer",
  "assignedTo": "admin"
}

返回值 ​

  • 返回形态:object

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/update", {
  "storyID": 1,
  "title": "<string>",
  "pri": 1,
  "module": 1,
  "parent": 1,
  "estimate": 1,
  "category": 1,
  "source": "<string>",
  "assignedTo": "<string>"
});

删除用户需求 ​

  • SDK 调用:request("requirement/delete", params)
  • HTTP:DELETE /requirements/{storyID}
  • 动作类型:delete
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

无请求体。

返回值 ​

  • 返回形态:text

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/delete", {
  "storyID": 1
});

激活用户需求 ​

  • SDK 调用:request("requirement/activate", params)
  • HTTP:PUT /requirements/{storyID}/activate
  • 动作类型:action
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "assignedTo": {
      "type": "string",
      "description": "指派给"
    },
    "comment": {
      "type": "string",
      "description": "备注"
    }
  }
}

示例:

json
{
  "assignedTo": "admin"
}

返回值 ​

  • 返回形态:text

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/activate", {
  "storyID": 1,
  "assignedTo": "<string>",
  "comment": "<string>"
});

变更用户需求 ​

  • SDK 调用:request("requirement/change", params)
  • HTTP:PUT /requirements/{storyID}/change
  • 动作类型:action
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "需求名称"
    },
    "spec": {
      "type": "string",
      "description": "需求描述"
    },
    "verify": {
      "type": "string",
      "description": "验收标准"
    },
    "reviewer": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "评审人员,如果无需评审则不传"
    }
  }
}

示例:

json
{
  "title": "智能头枕的颈椎保护",
  "spec": "描述",
  "verify": "验收标准"
}

返回值 ​

  • 返回形态:text

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/change", {
  "storyID": 1,
  "title": "<string>",
  "spec": "<string>",
  "verify": "<string>",
  "reviewer": [
    "<string>"
  ]
});

关闭用户需求 ​

  • SDK 调用:request("requirement/close", params)
  • HTTP:PUT /requirements/{storyID}/close
  • 动作类型:action
  • 最低禅道版本:22.0 / biz13.0 / max8.0 / ipd5.0

路径参数 ​

参数说明
storyID需求ID

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "closedReason": {
      "type": "string",
      "description": "关闭原因(done 已完成 | subdivided 已拆分 | duplicate 重复 | postponed 延期 | willnotdo 不做 | cancel 已取消 | bydesign 设计如此)"
    },
    "comment": {
      "type": "string",
      "description": "备注"
    }
  },
  "required": [
    "closedReason"
  ]
}

示例:

json
{
  "closedReason": "done"
}

返回值 ​

  • 返回形态:text

SDK 示例 ​

ts
import { request } from 'zentao-api';

const result = await request("requirement/close", {
  "storyID": 1,
  "closedReason": "<string>",
  "comment": "<string>"
});

Released under the MIT License.