ado-create-work-items
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseado-create-work-items
创建Azure DevOps工作项
Take a and create the work items in Azure DevOps by driving
the bundled . The script creates an optional parent
(Feature/Epic), then every item linked under it, and writes a
mapping each to its new /.
backlog_input.jsoncreate-backlog.csbacklog_result.jsonkeyidurlCreating items in a live org is outward-facing and effectively un-undoable (delete
is manual, links and notifications already fired). So this skill is built around a
hard gate: dry-run always, real run only on an explicit "yes".
For the exact JSON shapes (, , the
field that threads source row → ticket, and the process→types table) see
. Don't duplicate schemas here.
backlog_input.jsonbacklog_result.jsonkey${CLAUDE_PLUGIN_ROOT}/references/data-contracts.md接收文件,通过运行捆绑的脚本在Azure DevOps中创建工作项。该脚本可创建可选的父项(Feature/Epic),然后将所有子项链接到其下,并生成文件,将每个映射到新创建项的/。
backlog_input.jsoncreate-backlog.csbacklog_result.jsonkeyidurl在生产环境中创建工作项是对外操作,且无法撤销(删除需手动操作,链接和通知已发送)。因此本技能设置了严格的限制:始终先执行试运行,仅在用户明确回复“yes”后才执行真实创建。
关于确切的JSON格式(、、关联源行与工单的字段,以及流程→类型表),请参阅,请勿在此处重复定义 schema。
backlog_input.jsonbacklog_result.jsonkey${CLAUDE_PLUGIN_ROOT}/references/data-contracts.mdPrerequisites
前提条件
- Auth — sign in once: (the script fetches an Entra token for the Azure DevOps resource). Alternatively set
az login(PAT with Work Items Read & Write). See the$env:AZDO_PATskill for token/PAT details and tenant.ado-auth - Org/project — set /
$env:AZDO_ORG, or include$env:AZDO_PROJECT/orgin the JSON. Env vars override the JSON.project - .NET 10 SDK — is a .NET 10 file-based program.
create-backlog.cs - Unsure if prereqs are met? Run the checker:
powershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup_check.ps1"
Confirm the of each item is valid for the target project's process
(Agile vs Scrum vs Basic vs CMMI) — see the table in data-contracts.md. A type that
doesn't exist on the board is the most common dry-run failure.
type- 身份验证 — 登录一次:(脚本会获取Azure DevOps资源的Entra令牌)。或者设置
az login(具有工作项读写权限的PAT)。有关令牌/PAT和租户的详细信息,请参阅$env:AZDO_PAT技能。ado-auth - 组织/项目 — 设置/
$env:AZDO_ORG,或在JSON中包含$env:AZDO_PROJECT/org字段。环境变量优先级高于JSON配置。project - .NET 10 SDK — 是基于文件的.NET 10程序。
create-backlog.cs - 不确定是否满足前提条件?运行检查脚本:
powershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup_check.ps1"
确认每个项的对于目标项目的流程(Agile、Scrum、Basic或CMMI)有效——请参阅data-contracts.md中的表格。项类型在看板中不存在是试运行最常见的失败原因。
typeStep 1 — DRY RUN (default; creates nothing)
步骤1 — 试运行(默认模式;不创建任何项)
AZDO_DRY_RUNfalsevalidateOnly=truepowershell
$env:AZDO_ORG = "Cartagena365" # or rely on the JSON / already-set env
$env:AZDO_PROJECT = "GlassHull"
$env:AZDO_DRY_RUN = "true"
dotnet run "${CLAUDE_PLUGIN_ROOT}/scripts/create-backlog.cs" -- "<path>/backlog_input.json"The script prints a / line per item (and per parent), then a summary
like Relay that
list to the user. If anything is FAIL, stop and fix the input (usually a bad
for the process, a missing , or unescaped in an HTML
field like / ) before going on.
PASSFAILDRY RUN done. valid=N invalid=M. No work items were created.typeSystem.Title& < >Microsoft.VSTS.TCM.ReproStepsSystem.DescriptionAZDO_DRY_RUNfalsevalidateOnly=truepowershell
$env:AZDO_ORG = "Cartagena365" # 或依赖JSON配置/已设置的环境变量
$env:AZDO_PROJECT = "GlassHull"
$env:AZDO_DRY_RUN = "true"
dotnet run "${CLAUDE_PLUGIN_ROOT}/scripts/create-backlog.cs" -- "<path>/backlog_input.json"脚本会为每个项(包括父项)打印/行,然后输出摘要信息,例如。请将此结果列表告知用户。如果有任何项显示FAIL,请停止操作并修复输入(通常是流程对应的错误、缺少,或者HTML字段如/中存在未转义的),然后再继续。
PASSFAILDRY RUN done. valid=N invalid=M. No work items were created.typeSystem.TitleMicrosoft.VSTS.TCM.ReproStepsSystem.Description& < >Step 2 — REAL RUN (only after explicit approval)
步骤2 — 真实创建(仅在明确批准后执行)
Do not proceed until the user has clearly said yes (e.g. "create them",
"go ahead"). A clean dry-run is necessary but not sufficient — the human owns the
decision to write to their org.
Point at your working directory so the writeback step can find it,
then flip the gate to :
BACKLOG_RESULTfalsepowershell
$env:AZDO_DRY_RUN = "false"
$env:BACKLOG_RESULT = "<your-working-dir>/backlog_result.json"
dotnet run "${CLAUDE_PLUGIN_ROOT}/scripts/create-backlog.cs" -- "<path>/backlog_input.json"What happens: if the input has a , it is created first; every item is then
created and linked to it via (child → parent). If an item
has an , a child Task carrying the hours (Original/Remaining Work + the breakdown
in its description) is created under that item — so the hierarchy is Feature → Bug/Story → Task.
and , if set, are stamped on every item
( only on items that didn't already set their own ).
The script prints
per item and writes
( → / / / ). Failures are recorded per-item with an
field instead of an , so a partial run is visible rather than silent.
parentSystem.LinkTypes.Hierarchy-ReverseestimateAZDO_AREA_PATHAZDO_ASSIGNED_TOAZDO_ASSIGNED_TOSystem.AssignedTokey … -> <type> #<id>backlog_result.jsonkeyidurltypetitleerrorid请勿继续操作,直到用户明确表示同意(例如“创建它们”“继续执行”)。顺利完成试运行是必要条件,但并非充分条件——是否写入组织的决定权在用户手中。
将指向你的工作目录,以便回写步骤可以找到它,然后将试运行开关设置为:
BACKLOG_RESULTfalsepowershell
$env:AZDO_DRY_RUN = "false"
$env:BACKLOG_RESULT = "<your-working-dir>/backlog_result.json"
dotnet run "${CLAUDE_PLUGIN_ROOT}/scripts/create-backlog.cs" -- "<path>/backlog_input.json"执行过程:如果输入中包含,则先创建父项;然后创建所有子项,并通过(子项→父项)将其链接到父项。如果项包含,则会在该项下创建一个子Task,携带工时信息(Original/Remaining Work及其描述中的细分)——因此层级结构为Feature → Bug/Story → Task。如果设置了和,则会将其标记到所有项上(仅应用于未自行设置的项)。脚本会为每个项打印,并生成文件( → ///)。失败项会记录字段而非,因此可以看到部分运行结果,而非静默失败。
parentSystem.LinkTypes.Hierarchy-ReverseestimateAZDO_AREA_PATHAZDO_ASSIGNED_TOAZDO_ASSIGNED_TOSystem.AssignedTokey … -> <type> #<id>backlog_result.jsonkeyidurltypetitleerroridAfter creating — verify
创建后 — 验证
Confirm the items landed as intended. Query the new ids in one batch and check
, , and the parent link. Pull the ids from
and use the ADO MCP (or the
workitemsbatch REST endpoint). Spot-check that children show the expected parent.
System.WorkItemTypeSystem.Statebacklog_result.jsonwit_get_work_items_batch_by_ids确认工作项已按预期创建。批量查询新创建项的ID,检查、和父项链接。从中提取ID,使用ADO MCP的(或workitemsbatch REST端点)。抽样检查子项是否显示预期的父项。
System.WorkItemTypeSystem.Statebacklog_result.jsonwit_get_work_items_batch_by_idsIdempotency — don't double-create
幂等性 — 避免重复创建
create-backlog.csbacklog_input.jsonTicket IDTicket URLkeykeycreate-backlog.csbacklog_input.jsonTicket IDTicket URLkeykeyWindows notes
Windows注意事项
- The install path can contain spaces — always wrap and the JSON path in double quotes.
"${CLAUDE_PLUGIN_ROOT}/..." - Console is cp1252; the .cs program emits ASCII status lines, so output is safe. (The bundled Python scripts force UTF-8 for source dumps / writeback.)
- 安装路径可能包含空格——请始终用双引号包裹和JSON路径。
"${CLAUDE_PLUGIN_ROOT}/..." - 控制台编码为cp1252;.cs程序输出ASCII状态行,因此输出是安全的。(捆绑的Python脚本强制使用UTF-8进行源数据导出/回写。)