Skip to content

风险 (risk) ​

风险管理,支持获取风险列表、获取项目风险列表、获取执行风险列表、创建风险、获取风险详情、修改风险

动作概览 ​

SDK 动作说明方法路径
list获取风险列表GET/risks
projectRisks获取项目风险列表GET/projects/{projectID}/risks
executionRisks获取执行风险列表GET/executions/{executionID}/risks
create创建风险POST/risks
get获取风险详情GET/risks/{riskID}
update修改风险PUT/risks/{riskID}

获取风险列表 ​

  • SDK 调用:request("risk/list", params)
  • HTTP:GET /risks
  • 动作类型:list
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

无路径参数。

查询参数 ​

参数类型必填默认值说明
browseTypestring否all状态,默认是all
all 全部
active 开放
assignTo 指派给我
assignBy 由我指派
closed 已关闭
hangup 已挂起
canceled 已取消
orderBystring否排序
id_asc ID 升序
id_desc ID 降序
name_asc 名称 升序
name_desc 名称 降序
status_asc 状态 升序
status_desc 状态 降序
pri_asc 优先级 升序
pri_desc 优先级 降序
recPerPagenumber否每页数量,不超过1000
pageIDnumber否页码,从第1页开始
filtersarray否搜索条件数组,每项包含 field/operator/value/join/group;field 必须是该接口支持的搜索字段,operator 使用该接口搜索配置支持的操作符。支持搜索字段:activateBy,actualClosedDate,assignedTo,cancelBy,category,createdBy,createdDate,editedBy,editedDate,hangupBy,id,identifiedDate,impact,name,plannedClosedDate,prevention,pri,probability,project,rate,remedy,resolution,resolvedBy,source,status,strategy,trackedBy
groupJoinstring否条件组之间的连接方式
and and
or or

请求体 ​

无请求体。

返回值 ​

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

SDK 示例 ​

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

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

获取项目风险列表 ​

  • SDK 调用:request("risk/projectRisks", params)
  • HTTP:GET /projects/{projectID}/risks
  • 动作类型:list
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

参数说明
projectID项目ID

查询参数 ​

参数类型必填默认值说明
browseTypestring否all状态,默认是all
all 全部
active 开放
assignTo 指派给我
assignBy 由我指派
closed 已关闭
hangup 已挂起
canceled 已取消
orderBystring否排序
id_asc ID 升序
id_desc ID 降序
name_asc 名称 升序
name_desc 名称 降序
status_asc 状态 升序
status_desc 状态 降序
pri_asc 优先级 升序
pri_desc 优先级 降序
recPerPagenumber否每页数量,不超过1000
pageIDnumber否页码,从第1页开始
filtersarray否搜索条件数组,每项包含 field/operator/value/join/group;field 必须是该接口支持的搜索字段,operator 使用该接口搜索配置支持的操作符。支持搜索字段:activateBy,actualClosedDate,assignedTo,cancelBy,category,createdBy,createdDate,editedBy,editedDate,hangupBy,id,identifiedDate,impact,name,plannedClosedDate,prevention,pri,probability,project,rate,remedy,resolution,resolvedBy,source,status,strategy,trackedBy
groupJoinstring否条件组之间的连接方式
and and
or or

请求体 ​

无请求体。

返回值 ​

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

SDK 示例 ​

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

const result = await request("risk/projectRisks", {
  "projectID": 1,
  "browseType": "all",
  "orderBy": "id_asc",
  "recPerPage": 1,
  "pageID": 1,
  "filters": "<string>",
  "groupJoin": "and"
});

获取执行风险列表 ​

  • SDK 调用:request("risk/executionRisks", params)
  • HTTP:GET /executions/{executionID}/risks
  • 动作类型:list
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

参数说明
executionID执行ID

查询参数 ​

参数类型必填默认值说明
browseTypestring否all状态,默认是all
all 全部
active 开放
assignTo 指派给我
assignBy 由我指派
closed 已关闭
hangup 已挂起
canceled 已取消
orderBystring否排序
id_asc ID 升序
id_desc ID 降序
name_asc 名称 升序
name_desc 名称 降序
status_asc 状态 升序
status_desc 状态 降序
pri_asc 优先级 升序
pri_desc 优先级 降序
recPerPagenumber否每页数量,不超过1000
pageIDnumber否页码,从第1页开始
filtersarray否搜索条件数组,每项包含 field/operator/value/join/group;field 必须是该接口支持的搜索字段,operator 使用该接口搜索配置支持的操作符。支持搜索字段:activateBy,actualClosedDate,assignedTo,cancelBy,category,createdBy,createdDate,editedBy,editedDate,hangupBy,id,identifiedDate,impact,name,plannedClosedDate,prevention,pri,probability,project,rate,remedy,resolution,resolvedBy,source,status,strategy,trackedBy
groupJoinstring否条件组之间的连接方式
and and
or or

请求体 ​

无请求体。

返回值 ​

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

SDK 示例 ​

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

const result = await request("risk/executionRisks", {
  "executionID": 1,
  "browseType": "all",
  "orderBy": "id_asc",
  "recPerPage": 1,
  "pageID": 1,
  "filters": "<string>",
  "groupJoin": "and"
});

创建风险 ​

  • SDK 调用:request("risk/create", params)
  • HTTP:POST /risks
  • 动作类型:create
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

无路径参数。

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "project": {
      "type": "integer",
      "description": "所属项目",
      "format": "int32"
    },
    "name": {
      "type": "string",
      "description": "风险名称"
    },
    "execution": {
      "type": "integer",
      "description": "所属执行",
      "format": "int32"
    },
    "source": {
      "type": "string",
      "description": "来源(business 业务部门 | team 项目组 | logistic 项目保障科室 | manage 管理层 | sourcing 供应商-采购 | outsourcing 供应商-外包 | customer 外部客户 | others 其他)"
    },
    "category": {
      "type": "string",
      "description": "类型(technical 技术类 | manage 管理类 | business 业务类 | requirement 需求类 | resource 资源类 | others 其他)"
    },
    "strategy": {
      "type": "string",
      "description": "策略(avoidance 规避 | mitigation 缓解 | transference 转移 | acceptance 接受)"
    },
    "impact": {
      "type": "integer",
      "description": "影响程度(1-5)",
      "format": "int32"
    },
    "probability": {
      "type": "integer",
      "description": "发生概率(1-5)",
      "format": "int32"
    },
    "rate": {
      "type": "integer",
      "description": "风险系数",
      "format": "int32"
    },
    "pri": {
      "type": "integer",
      "description": "优先级(1 高 | 2 中 | 3 低)",
      "format": "int32"
    },
    "identifiedDate": {
      "type": "string",
      "description": "识别日期"
    },
    "plannedClosedDate": {
      "type": "string",
      "description": "计划关闭日期"
    },
    "assignedTo": {
      "type": "string",
      "description": "指派给"
    },
    "prevention": {
      "type": "string",
      "description": "应对措施"
    },
    "remedy": {
      "type": "string",
      "description": "响应措施"
    }
  },
  "required": [
    "project",
    "name",
    "impact",
    "probability",
    "pri"
  ]
}

示例:

json
{
  "project": 2,
  "name": "关键路径延期",
  "execution": 3,
  "source": "business",
  "category": "technical",
  "strategy": "avoidance",
  "impact": 3,
  "probability": 3,
  "rate": 9,
  "pri": 2,
  "identifiedDate": "2026-01-01",
  "plannedClosedDate": "2026-03-01",
  "assignedTo": "admin"
}

返回值 ​

  • 返回形态:object

SDK 示例 ​

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

const result = await request("risk/create", {
  "project": 1,
  "name": "<string>",
  "execution": 1,
  "source": "<string>",
  "category": "<string>",
  "strategy": "<string>",
  "impact": 1,
  "probability": 1,
  "rate": 1,
  "pri": 1,
  "identifiedDate": "<string>",
  "plannedClosedDate": "<string>",
  "assignedTo": "<string>",
  "prevention": "<string>",
  "remedy": "<string>"
});

获取风险详情 ​

  • SDK 调用:request("risk/get", params)
  • HTTP:GET /risks/{riskID}
  • 动作类型:get
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

参数说明
riskID风险ID

查询参数 ​

无查询参数。

请求体 ​

无请求体。

返回值 ​

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

SDK 示例 ​

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

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

修改风险 ​

  • SDK 调用:request("risk/update", params)
  • HTTP:PUT /risks/{riskID}
  • 动作类型:update
  • 最低禅道版本:22.5 / biz13.5 / max8.5 / ipd5.5

路径参数 ​

参数说明
riskID风险ID

查询参数 ​

无查询参数。

请求体 ​

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "风险名称"
    },
    "source": {
      "type": "string",
      "description": "来源(business 业务部门 | team 项目组 | logistic 项目保障科室 | manage 管理层 | sourcing 供应商-采购 | outsourcing 供应商-外包 | customer 外部客户 | others 其他)"
    },
    "category": {
      "type": "string",
      "description": "类型(technical 技术类 | manage 管理类 | business 业务类 | requirement 需求类 | resource 资源类 | others 其他)"
    },
    "strategy": {
      "type": "string",
      "description": "策略(avoidance 规避 | mitigation 缓解 | transference 转移 | acceptance 接受)"
    },
    "impact": {
      "type": "integer",
      "description": "影响程度(1-5)",
      "format": "int32"
    },
    "probability": {
      "type": "integer",
      "description": "发生概率(1-5)",
      "format": "int32"
    },
    "rate": {
      "type": "integer",
      "description": "风险系数",
      "format": "int32"
    },
    "pri": {
      "type": "integer",
      "description": "优先级(1 高 | 2 中 | 3 低)",
      "format": "int32"
    },
    "identifiedDate": {
      "type": "string",
      "description": "识别日期"
    },
    "plannedClosedDate": {
      "type": "string",
      "description": "计划关闭日期"
    },
    "assignedTo": {
      "type": "string",
      "description": "指派给"
    },
    "prevention": {
      "type": "string",
      "description": "应对措施"
    },
    "remedy": {
      "type": "string",
      "description": "响应措施"
    },
    "resolution": {
      "type": "string",
      "description": "解决措施"
    }
  },
  "required": [
    "name"
  ]
}

示例:

json
{
  "name": "关键路径延期",
  "source": "business",
  "category": "technical",
  "strategy": "avoidance",
  "impact": 3,
  "probability": 3,
  "rate": 9,
  "pri": 2,
  "identifiedDate": "2026-01-01",
  "plannedClosedDate": "2026-03-01",
  "assignedTo": "admin"
}

返回值 ​

  • 返回形态:object

SDK 示例 ​

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

const result = await request("risk/update", {
  "riskID": 1,
  "name": "<string>",
  "source": "<string>",
  "category": "<string>",
  "strategy": "<string>",
  "impact": 1,
  "probability": 1,
  "rate": 1,
  "pri": 1,
  "identifiedDate": "<string>",
  "plannedClosedDate": "<string>",
  "assignedTo": "<string>",
  "prevention": "<string>",
  "remedy": "<string>",
  "resolution": "<string>"
});

Released under the MIT License.