tapd:status-update
586 字约 2 分钟
tapd:status-update
更新 TAPD 关联项(story、task 或 bug)状态
使用场景:希望 TAPD 工作项状态跟随代码进展自动流转时使用,例如 PR 合并后将关联项设为「已完成」。
该任务会更新流水线关联的 TAPD 工作项。关联项的识别方式、fromFile / fromText 参数优先级和前提条件, 请参见 tapd:comment 的关联项筛选规则。
适用事件
参数
以下列表先概览 tapd:status-update 的全部参数。
- status:目标状态
- when:仅更新指定状态的工作项
- type:仅更新指定类型(story/task/bug)的工作项
- fromText:从文本解析 commit id,查询关联工作项
- fromFile:从文件解析 commit id,查询关联工作项
各参数详细说明如下。
status
- type:
String - required:
true
目标状态。
when
- type:
String|Array<String> - required:
false
更新指定状态的工作项,为空时不做过滤。
type
Enum<String>: story | task | bug- required:
false
更新指定类型的工作项,为空时不做过滤。
fromText
- type:
String - required:
false
从文本中解析出 commit id,查询其关联的工作项。
fromFile
- type:
String - required:
false
从文本文件中解析出 commit id,查询其关联的工作项。
配置样例
- 更新所有 TAPD 关联项的状态
.cnb.yml
main:
push:
- stages:
- name: update tapd status
type: tapd:status-update
options:
status: 进行中- 对符合条件的 TAPD 关联项更新状态
.cnb.yml
main:
pull_request.merged:
- stages:
- name: update tapd status
type: tapd:status-update
options:
status: 已完成
when:
- 进行中
type: story- 从
fromText中解析 commit id,查询 TAPD 关联项并更新状态
.cnb.yml
$:
tag_push:
- stages:
- name: 生成 changelog
image: cnbcool/changelog
settings:
dryRun: true
linkReferences: false
exports:
latestChangeLog: RELEASE_NOTES
- name: tapd
type: tapd:status-update
options:
status: 已发布
type: story
fromText: $RELEASE_NOTES