azure-devops-workitems

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Azure DevOps Work Items Explorer

Azure DevOps工作项浏览器

Explore and manage Epics, Features, User Stories, and Tasks in an Azure DevOps project using
az boards
CLI commands. Five modes: overview, get epic, get feature, create, and edit.
Announce at start: "I'm using the azure-devops-workitems skill to work with Azure DevOps work items."
Prerequisite:
az
CLI +
azure-devops
extension + active login. If missing, use the azure-devops-cli skill to set up first.

使用
az boards
CLI命令探索并管理Azure DevOps项目中的Epic、Feature、用户故事和任务。包含五种模式:概览、获取Epic详情、获取Feature详情、创建工作项和编辑工作项。
启动时提示: "我正在使用azure-devops-workitems技能来处理Azure DevOps工作项。"
前置条件: 已安装
az
CLI及
azure-devops
扩展,且处于已登录状态。如果未安装,请先使用azure-devops-cli技能进行配置。

Project Resolution (all modes)

项目确定(所有模式通用)

Used at the start of every mode to determine the target project:
  1. If the user provides a project name, use it (pass
    --project <name>
    )
  2. Else read default:
    az devops configure --list | grep project
  3. If no default set, ask the user

在所有模式启动时使用,用于确定目标项目:
  1. 如果用户提供了项目名称,直接使用(传入
    --project <name>
  2. 否则读取默认项目:
    az devops configure --list | grep project
  3. 如果未设置默认项目,询问用户

Mode 1: Overview (Tree)

模式1:概览(树形结构)

Display the full work item hierarchy for a project.
Steps:
  1. Resolve project
  2. Query all Epics:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State], [System.AssignedTo] FROM WorkItems WHERE [System.WorkItemType] = 'Epic' AND [System.TeamProject] = '@project' ORDER BY [System.Id]" --project <project> -o json
  1. For each Epic, fetch child Features via relations:
bash
az boards work-item show --id <epic_id> --expand relations -o json
Parse
relations
array for entries where
rel == "System.LinkTypes.Hierarchy-Forward"
. Extract child IDs from the
url
field (last path segment), then fetch each child. Note: the item
id
is at the top level of the response (not inside
fields
).
  1. For each Feature, fetch child User Stories/Tasks the same way.
  2. Display as an indented tree:
Epic #1234 [Active] - Platform Modernization (Assigned: Alice)
  Feature #1235 [Active] - Migrate to new API (Assigned: Bob)
    Story #1240 [New] - Implement auth endpoint (Assigned: Carol)
    Task #1241 [Active] - Write unit tests (Assigned: Dave)
  Feature #1236 [Resolved] - Update CI pipeline (Assigned: Eve)
Fields per line: ID, State, Title, Assigned To

展示项目的完整工作项层级结构。
步骤:
  1. 确定目标项目
  2. 查询所有Epic:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State], [System.AssignedTo] FROM WorkItems WHERE [System.WorkItemType] = 'Epic' AND [System.TeamProject] = '@project' ORDER BY [System.Id]" --project <project> -o json
  1. 针对每个Epic,通过关联关系获取其子Feature:
bash
az boards work-item show --id <epic_id> --expand relations -o json
解析
relations
数组中
rel == "System.LinkTypes.Hierarchy-Forward"
的条目。从
url
字段的最后一段路径提取子项ID,然后获取每个子项的信息。注意:工作项
id
位于响应的顶级层级(不在
fields
内部)。
  1. 针对每个Feature,以相同方式获取其子用户故事/任务。
  2. 以缩进树形结构展示:
Epic #1234 [Active] - 平台现代化(负责人:Alice)
  Feature #1235 [Active] - 迁移至新API(负责人:Bob)
    Story #1240 [New] - 实现认证端点(负责人:Carol)
    Task #1241 [Active] - 编写单元测试(负责人:Dave)
  Feature #1236 [Resolved] - 更新CI流水线(负责人:Eve)
每行字段: ID、状态、标题、负责人

Mode 2: Get Epic

模式2:获取Epic详情

Show detailed info for a specific Epic and its child Features.
Steps:
  1. Resolve project
  2. If Epic ID provided, fetch it directly. If not, search by title:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Epic' AND [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
If multiple matches, let the user pick.
  1. Fetch the Epic with relations:
bash
az boards work-item show --id <epic_id> --expand relations -o json
  1. Display the Epic detail card:
    • ID, Title, State, Assigned To
    • Iteration Path, Area Path, Tags, Priority
    • Description (strip HTML to plain text)
  2. List child Features in a table below:
    • ID, Title, State, Assigned To, Iteration Path

展示指定Epic的详细信息及其子Feature。
步骤:
  1. 确定目标项目
  2. 如果提供了Epic ID,直接获取;否则按标题搜索:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Epic' AND [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
如果存在多个匹配项,让用户选择。
  1. 获取包含关联关系的Epic信息:
bash
az boards work-item show --id <epic_id> --expand relations -o json
  1. 展示Epic详情卡片:
    • ID、标题、状态、负责人
    • 迭代路径、区域路径、标签、优先级
    • 描述(去除HTML格式转为纯文本)
  2. 在卡片下方以表格形式列出子Feature:
    • ID、标题、状态、负责人、迭代路径

Mode 3: Get Feature

模式3:获取Feature详情

Show detailed info for a specific Feature, its child User Stories, and their child Tasks.
Steps:
  1. Resolve project
  2. If Feature ID provided, fetch directly. If not, search by title:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Feature' AND [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
If multiple matches, let the user pick.
  1. Fetch the Feature with relations:
bash
az boards work-item show --id <feature_id> --expand relations -o json
  1. Display the Feature detail card:
    • ID, Title, State, Assigned To
    • Iteration Path, Area Path, Tags, Priority
    • Description (strip HTML to plain text)
  2. Fetch child User Stories via
    Hierarchy-Forward
    relations.
  3. For each User Story, fetch child Tasks via
    Hierarchy-Forward
    relations.
  4. Display as an indented tree below the card:
User Story #2001 [Active] - As a user I can login (Assigned: Alice)
  Task #2010 [Active] - Implement login API (Assigned: Bob)
  Task #2011 [New] - Write login tests (Assigned: Carol)
User Story #2002 [New] - As a user I can reset password (Assigned: Dave)
  Task #2020 [New] - Design reset flow (Assigned: Eve)
Fields per line: ID, Work Item Type, State, Title, Assigned To

展示指定Feature的详细信息、其子用户故事及子任务。
步骤:
  1. 确定目标项目
  2. 如果提供了Feature ID,直接获取;否则按标题搜索:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Feature' AND [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
如果存在多个匹配项,让用户选择。
  1. 获取包含关联关系的Feature信息:
bash
az boards work-item show --id <feature_id> --expand relations -o json
  1. 展示Feature详情卡片:
    • ID、标题、状态、负责人
    • 迭代路径、区域路径、标签、优先级
    • 描述(去除HTML格式转为纯文本)
  2. 通过
    Hierarchy-Forward
    关联关系获取子用户故事。
  3. 针对每个用户故事,通过
    Hierarchy-Forward
    关联关系获取其子任务。
  4. 在卡片下方以缩进树形结构展示:
User Story #2001 [Active] - 作为用户,我可以登录(负责人:Alice)
  Task #2010 [Active] - 实现登录API(负责人:Bob)
  Task #2011 [New] - 编写登录测试(负责人:Carol)
User Story #2002 [New] - 作为用户,我可以重置密码(负责人:Dave)
  Task #2020 [New] - 设计重置流程(负责人:Eve)
每行字段: ID、工作项类型、状态、标题、负责人

Mode 4: Create Work Item

模式4:创建工作项

Create a new Epic, Feature, User Story, or Task.
Steps:
  1. Resolve project
  2. Determine work item type (ask if not specified)
  3. For non-Epic types, get the parent ID (mandatory):
    • Feature -> must have a parent Epic
    • User Story -> must have a parent Feature
    • Task -> must have a parent User Story
    • Do not create a Feature, User Story, or Task without a parent
  4. Gather fields: Title (required) + optional fields below
创建新的Epic、Feature、用户故事或任务。
步骤:
  1. 确定目标项目
  2. 确定工作项类型(如果未指定则询问用户)
  3. 对于非Epic类型,必须获取父项ID:
    • Feature必须有父Epic
    • 用户故事必须有父Feature
    • 任务必须有父用户故事
    • 禁止在没有父项的情况下创建Feature、用户故事或任务
  4. 收集字段信息:标题(必填)及以下可选字段

Defaults

默认值

FieldDefault
Assigned ToCurrent logged-in user (resolve via
az account show --query "user.name" -o tsv
)
Area Path
NLASTIC\Data Engineering
Iteration Path
NLASTIC
(backlog)
Effort
2
(Feature only — see Estimation section below)
Description
TBD
(if user does not provide one — see Description section below for format)
字段默认值
负责人当前登录用户(通过
az account show --query "user.name" -o tsv
获取)
区域路径
NLASTIC\Data Engineering
迭代路径
NLASTIC
(待办事项)
工作量
2
(仅Feature适用——见下方估算部分)
描述
TBD
(如果用户未提供——见下方描述部分的格式要求)

Estimation

估算规则

1 story point = 1 working day = 6 net working hours.
Feature — Effort field (
Microsoft.VSTS.Scheduling.Effort
):
  • Measured in story points
  • Default: 2 (= 2 working days / 12 net hours)
  • Set to 2 unless the user specifies a different value
User Story — Story Points field (
Microsoft.VSTS.Scheduling.StoryPoints
):
  • Measured in story points
  • Default: same as the parent Feature's Effort (2 if not specified)
Task — Original Estimate field (
Microsoft.VSTS.Scheduling.OriginalEstimate
):
  • Measured in working hours
  • No default — derive from the parent Feature's Effort when possible (e.g., a Feature with Effort 2 = 12 hours, split across its child Tasks)
  • If the user provides an estimate, use it as-is
1个故事点 = 1个工作日 = 6个净工作小时。
Feature — 工作量字段 (
Microsoft.VSTS.Scheduling.Effort
):
  • 故事点为单位
  • 默认值:2(=2个工作日/12个净工作小时)
  • 除非用户指定其他值,否则设置为2
用户故事 — 故事点字段 (
Microsoft.VSTS.Scheduling.StoryPoints
):
  • 故事点为单位
  • 默认值:与父Feature的工作量相同(如果未指定则为2)
任务 — 初始估算字段 (
Microsoft.VSTS.Scheduling.OriginalEstimate
):
  • 工作小时为单位
  • 无默认值——尽可能从父Feature的工作量推导(例如,工作量为2的Feature对应12小时,拆分到其子任务中)
  • 如果用户提供估算值,直接使用

Description

描述要求

When the user provides a description (or you compose one based on context), write it in Markdown format. Structure the description with headings, bullet points, bold text, and other Markdown elements as appropriate for the content. This makes descriptions more readable and organized in Azure DevOps.
Example — User Story description:
markdown
undefined
当用户提供描述(或根据上下文生成描述)时,使用Markdown格式编写。根据内容适当使用标题、项目符号、粗体等Markdown元素,使描述在Azure DevOps中更易读、更有条理。
示例——用户故事描述:
markdown
undefined

Overview

概述

Allow users to reset their password via email link.
允许用户通过邮件链接重置密码。

Acceptance Criteria

验收标准

  • User receives a reset link within 60 seconds
  • Link expires after 24 hours
  • Password must meet complexity requirements
  • 用户在60秒内收到重置链接
  • 链接24小时后过期
  • 密码必须符合复杂度要求

Notes

备注

Depends on the email service integration from Feature #1235.

**Example — Task description:**

```markdown
依赖Feature #1235中的邮件服务集成。

**示例——任务描述:**

```markdown

Objective

目标

Write unit tests covering the login API endpoint.
编写覆盖登录API端点的单元测试。

Scope

范围

  • Happy path: valid credentials return a JWT token
  • Error cases: invalid password, locked account, expired session
  • Edge cases: concurrent login attempts

If the user does not provide a description, use the default `TBD`.
  • 正常流程: 有效凭证返回JWT令牌
  • 错误场景: 密码无效、账户锁定、会话过期
  • 边缘场景: 并发登录尝试

如果用户未提供描述,使用默认值`TBD`。

Area Path

区域路径

Default:
NLASTIC\Data Engineering
.
Before creating, explore sub-Area Paths and suggest a more specific one based on the work item context:
bash
az boards area project list --project NLASTIC --depth 3 -o json
The response is a tree with
path
and
children
fields. Walk the tree to find nodes under
Data Engineering
. Suggest the best match based on the work item context. Use the default
NLASTIC\Data Engineering
if the user accepts or no better match exists.
默认值:
NLASTIC\Data Engineering
创建前,探索子区域路径并根据工作项上下文推荐更具体的路径:
bash
az boards area project list --project NLASTIC --depth 3 -o json
响应结果是包含
path
children
字段的树形结构。遍历
Data Engineering
下的节点,根据工作项上下文推荐最佳匹配路径。如果用户接受或没有更合适的匹配项,则使用默认值
NLASTIC\Data Engineering

Iteration Path

迭代路径

Default:
NLASTIC
(backlog-level, no sprint).
If the user indicates the item is for the current sprint, resolve it:
bash
az boards iteration team list --team "Data Engineering" --project NLASTIC -o json
Each entry has
path
and
attributes.startDate
/
attributes.finishDate
. Find the iteration whose date range contains the current date (match by current month and year). Sprints are named by month (e.g.
NLASTIC\March 2026
). If no exact match, show available sprints and let the user pick.
默认值:
NLASTIC
(待办事项层级,无迭代周期)。
如果用户表示工作项属于当前迭代周期,则通过以下命令获取:
bash
az boards iteration team list --team "Data Engineering" --project NLASTIC -o json
每个条目包含
path
attributes.startDate
/
attributes.finishDate
。查找包含当前日期的迭代周期(按年月匹配)。迭代周期以月份命名(例如
NLASTIC\March 2026
)。如果没有完全匹配的结果,展示可用的迭代周期让用户选择。

Confirmation before create

创建前确认

Before executing, display a summary of all fields and ask for confirmation:
About to create:
  Type:           Feature
  Title:          Migrate to new API
  Assigned To:    bnachlieli@nvidia.com  (from az account)
  Area Path:      NLASTIC\Data Engineering
  Iteration Path: NLASTIC
  Effort:         2 story points  (= 2 working days / 12 net hours)
  Priority:       2
  Parent:         Epic #1234
  Description:    TBD

Proceed? (yes / no / edit fields)
Only execute after the user explicitly confirms. If the user says no or wants edits, let them adjust and re-show the summary.
执行创建操作前,展示所有字段的汇总信息并请求确认:
即将创建:
  类型:           Feature
  标题:          迁移至新API
  负责人:    bnachlieli@nvidia.com  (来自az account)
  区域路径:      NLASTIC\Data Engineering
  迭代路径: NLASTIC
  工作量:         2个故事点  (= 2个工作日 / 12个净工作小时)
  优先级:       2
  父项:         Epic #1234
  描述:    TBD

是否继续?(是/否/编辑字段)
**仅在用户明确确认后执行创建操作。**如果用户选择否或需要编辑字段,允许用户调整后重新展示汇总信息。

Create command

创建命令

Step 1 — Create the work item (without description):
bash
az boards work-item create \
  --type "<Type>" \
  --title "<Title>" \
  --project "<Project>" \
  --fields "System.AssignedTo=<user>" \
           "System.IterationPath=<iteration>" \
           "System.AreaPath=<area>" \
           "System.Tags=<tags>" \
           "Microsoft.VSTS.Common.Priority=<1-4>" \
  -o json
For Features, add Effort (story points):
bash
           "Microsoft.VSTS.Scheduling.Effort=<story_points>"
For User Stories, add Story Points:
bash
           "Microsoft.VSTS.Scheduling.StoryPoints=<story_points>"
For Tasks, add Original Estimate (hours) if provided:
bash
           "Microsoft.VSTS.Scheduling.OriginalEstimate=<hours>"
Capture the new work item
id
from the JSON response.
Step 2 — Set the description in Markdown format via REST API:
The
az boards
CLI stores descriptions as HTML by default. To store the description as rendered Markdown, use the REST API with
multilineFieldsFormat
:
bash
az rest --method patch \
  --uri "https://dev.azure.com/<org>/<project>/_apis/wit/workitems/<id>?api-version=7.1-preview.3" \
  --resource "499b84ac-1321-427f-aa17-267ca6975798" \
  --headers "Content-Type=application/json-patch+json" \
  --body '[
    {"op": "add", "path": "/fields/System.Description", "value": "<markdown_description>"},
    {"op": "add", "path": "/multilineFieldsFormat/System.Description", "value": "Markdown"}
  ]'
Resolve
<org>
and
<project>
from the configured defaults (
az devops configure --list
). The
--resource
flag is required for
az rest
to authenticate against Azure DevOps.
Important: Once a description is saved in Markdown format, it cannot be reverted to HTML.
步骤1 — 创建工作项(不含描述):
bash
az boards work-item create \
  --type "<Type>" \
  --title "<Title>" \
  --project "<Project>" \
  --fields "System.AssignedTo=<user>" \
           "System.IterationPath=<iteration>" \
           "System.AreaPath=<area>" \
           "System.Tags=<tags>" \
           "Microsoft.VSTS.Common.Priority=<1-4>" \
  -o json
对于Feature,添加工作量(故事点):
bash
           "Microsoft.VSTS.Scheduling.Effort=<story_points>"
对于用户故事,添加故事点:
bash
           "Microsoft.VSTS.Scheduling.StoryPoints=<story_points>"
对于任务,如果提供了初始估算(小时)则添加:
bash
           "Microsoft.VSTS.Scheduling.OriginalEstimate=<hours>"
从JSON响应中捕获新工作项的
id
步骤2 — 通过REST API设置Markdown格式的描述:
az boards
CLI默认将描述存储为HTML格式。要将描述存储为渲染后的Markdown格式,使用带有
multilineFieldsFormat
参数的REST API:
bash
az rest --method patch \
  --uri "https://dev.azure.com/<org>/<project>/_apis/wit/workitems/<id>?api-version=7.1-preview.3" \
  --resource "499b84ac-1321-427f-aa17-267ca6975798" \
  --headers "Content-Type=application/json-patch+json" \
  --body '[
    {"op": "add", "path": "/fields/System.Description", "value": "<markdown_description>"},
    {"op": "add", "path": "/multilineFieldsFormat/System.Description", "value": "Markdown"}
  ]'
从配置的默认值中解析
<org>
<project>
az devops configure --list
)。
--resource
参数是
az rest
对Azure DevOps进行身份验证所必需的。
重要提示: 一旦描述以Markdown格式保存,无法再恢复为HTML格式。

Link to parent (mandatory for non-Epic types)

关联父项(非Epic类型必填)

bash
az boards work-item relation add \
  --id <new_item_id> \
  --relation-type Parent \
  --target-id <parent_id>
After creation: display the new item's ID, Title, State, URL, Area Path, Iteration Path, and parent link confirmation.
bash
az boards work-item relation add \
  --id <new_item_id> \
  --relation-type Parent \
  --target-id <parent_id>
创建完成后: 展示新工作项的ID、标题、状态、URL、区域路径、迭代路径及父项关联确认信息。

Auto-create hierarchy under Feature

自动在Feature下创建层级

Whenever a Feature is created, automatically create a child User Story and a child Task under it:
User Story:
  • Title: same as the Feature title, unless the user specifies a different name
  • Story Points: same as the Feature's Effort (default 2)
  • Fields: inherit Assigned To, Area Path, Iteration Path, and Description from the Feature
  • Link to the Feature as its parent
Task (under the User Story):
  • Title:
    buffer
    , unless the user specifies a different name
  • Original Estimate: converted from the User Story's Story Points (story points x 6 hours) (e.g., 2 story points = 12 hours)
  • Fields: inherit Assigned To, Area Path, and Iteration Path from the User Story
  • Link to the User Story as its parent
Include all three items in the confirmation summary before creating:
About to create:
  1) Feature: "Migrate to new API"  (Effort: 2 SP, parent: Epic #1234)
  2) User Story: "Migrate to new API"  (Story Points: 2, parent: the new Feature)
  3) Task: "buffer"  (Original Estimate: 12h, parent: the new User Story)

Proceed? (yes / no / edit fields)
After all items are created, display all IDs and their parent-child relationships.

每当创建Feature时,自动在其下创建一个子用户故事和一个子任务
用户故事:
  • 标题: 与Feature标题相同,除非用户指定其他名称
  • 故事点: 与Feature的工作量相同(默认2)
  • 字段: 继承Feature的负责人、区域路径、迭代路径和描述
  • 关联Feature作为父项
任务(属于该用户故事):
  • 标题:
    buffer
    ,除非用户指定其他名称
  • 初始估算: 从用户故事的故事点转换而来(故事点×6小时)(例如,2个故事点=12小时)
  • 字段: 继承用户故事的负责人、区域路径和迭代路径
  • 关联用户故事作为父项
在创建前的确认汇总中包含这三个工作项:
即将创建:
  1) Feature: "迁移至新API"  (工作量: 2个故事点, 父项: Epic #1234)
  2) User Story: "迁移至新API"  (故事点: 2, 父项: 新创建的Feature)
  3) Task: "buffer"  (初始估算: 12小时, 父项: 新创建的User Story)

是否继续?(是/否/编辑字段)
所有工作项创建完成后,展示所有ID及其父子关系。

Mode 5: Edit Work Item

模式5:编辑工作项

Update fields on an existing Epic, Feature, User Story, or Task.
Steps:
  1. Resolve project
  2. If item ID provided, fetch it. If not, ask for ID or search by title:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType] FROM WorkItems WHERE [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
  1. Display current values for the item
  2. Ask which fields to update
更新现有Epic、Feature、用户故事或任务的字段。
步骤:
  1. 确定目标项目
  2. 如果提供了工作项ID,直接获取;否则询问ID或按标题搜索:
bash
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType] FROM WorkItems WHERE [System.Title] CONTAINS '<search_term>' AND [System.TeamProject] = '@project'" --project <project> -o json
  1. 展示工作项的当前字段值
  2. 询问用户需要更新哪些字段

Editable fields

可编辑字段

  • Title, State, Assigned To, Description
  • Iteration Path, Area Path, Tags, Priority
  • 标题、状态、负责人、描述
  • 迭代路径、区域路径、标签、优先级

Confirmation before update

更新前确认

Before executing, display a before/after summary and ask for confirmation:
About to update #2001:
  Field           Current                 New
  State           New                     Active
  Priority        3                       2

Proceed? (yes / no / edit fields)
Only execute after the user explicitly confirms. If the user says no or wants edits, let them adjust and re-show the summary.
执行更新操作前,展示更新前后的汇总信息并请求确认:
即将更新#2001:
  字段           当前值                 新值
  状态           New                     Active
  优先级        3                       2

是否继续?(是/否/编辑字段)
**仅在用户明确确认后执行更新操作。**如果用户选择否或需要编辑字段,允许用户调整后重新展示汇总信息。

Update command

更新命令

For fields other than Description, use the standard update command:
bash
az boards work-item update \
  --id <id> \
  --fields "System.Title=<new_title>" \
           "System.State=<new_state>" \
           "System.AssignedTo=<user>" \
           "Microsoft.VSTS.Common.Priority=<1-4>"
If updating the Description, use the REST API to set/preserve Markdown format:
bash
az rest --method patch \
  --uri "https://dev.azure.com/<org>/<project>/_apis/wit/workitems/<id>?api-version=7.1-preview.3" \
  --resource "499b84ac-1321-427f-aa17-267ca6975798" \
  --headers "Content-Type=application/json-patch+json" \
  --body '[
    {"op": "replace", "path": "/fields/System.Description", "value": "<markdown_description>"},
    {"op": "add", "path": "/multilineFieldsFormat/System.Description", "value": "Markdown"}
  ]'
Use
"op": "replace"
when the description already has a value,
"op": "add"
for new descriptions. Both commands can be combined in a single turn if updating description alongside other fields.
After update: show a before/after comparison of changed fields and confirm success.
对于描述以外的字段,使用标准更新命令:
bash
az boards work-item update \
  --id <id> \
  --fields "System.Title=<new_title>" \
           "System.State=<new_state>" \
           "System.AssignedTo=<user>" \
           "Microsoft.VSTS.Common.Priority=<1-4>"
如果更新描述,使用REST API来设置/保留Markdown格式:
bash
az rest --method patch \
  --uri "https://dev.azure.com/<org>/<project>/_apis/wit/workitems/<id>?api-version=7.1-preview.3" \
  --resource "499b84ac-1321-427f-aa17-267ca6975798" \
  --headers "Content-Type=application/json-patch+json" \
  --body '[
    {"op": "replace", "path": "/fields/System.Description", "value": "<markdown_description>"},
    {"op": "add", "path": "/multilineFieldsFormat/System.Description", "value": "Markdown"}
  ]'
当描述已有值时使用
"op": "replace"
,对于新描述使用
"op": "add"
。如果同时更新描述和其他字段,可以在同一操作中组合这两个命令。
更新完成后: 展示已更改字段的前后对比信息,并确认更新成功。

Common state transitions

常见状态流转

TypeStates
Epic / FeatureNew, Active, Resolved, Closed
User StoryNew, Active, Resolved, Closed
TaskNew, Active, Closed

类型状态
Epic / FeatureNew, Active, Resolved, Closed
用户故事New, Active, Resolved, Closed
任务New, Active, Closed

Quick Reference

快速参考

TaskCommand
Query work items
az boards query --wiql "..." --project <project>
Show work item
az boards work-item show --id <id> --expand relations
Create work item
az boards work-item create --type <type> --title "<title>" --fields ...
Update work item
az boards work-item update --id <id> --fields ...
Link parent
az boards work-item relation add --id <id> --relation-type Parent --target-id <pid>
List area paths
az boards area team list --team "<team>" --project <project>
List iterations
az boards iteration team list --team "<team>" --project <project>
任务命令
查询工作项
az boards query --wiql "..." --project <project>
查看工作项详情
az boards work-item show --id <id> --expand relations
创建工作项
az boards work-item create --type <type> --title "<title>" --fields ...
更新工作项
az boards work-item update --id <id> --fields ...
关联父项
az boards work-item relation add --id <id> --relation-type Parent --target-id <pid>
列出区域路径
az boards area team list --team "<team>" --project <project>
列出迭代周期
az boards iteration team list --team "<team>" --project <project>