Files
awesome-copilot/skills/azure-devops-cli/references/boards-and-iterations.md
T
Komal Vardhan Lolugu 4e8726dd50 azure-devops-cli: handle long comments on Windows (#2061) (#2140)
* azure-devops-cli: handle long comments on Windows (#2061)

On Windows 'az' is a cmd.exe batch wrapper capped at ~8191 characters,
so a long --discussion / --description value silently truncates or
fails. Document three verified ways out so the coding agent doesn't
waste 3-5 turns falling back to raw token retrieval and REST:

1. azps.ps1 in PowerShell on Windows. Same Azure CLI, invoked through
   the Python entry point with no cmd.exe length cap. Pair with
   'Get-Content -Raw' so the body lives in a variable, not on the
   command line.

2. Native --file-path flags where Azure CLI offers them. Applies to
   'az devops wiki page create' and 'az devops wiki page update', both
   documented with --encoding.

3. 'az devops invoke --in-file' as the universal escape hatch for
   commands with no --file-path (work-item --discussion, PR
   --description). Documented example posts to the work item
   comments REST endpoint with api-version 7.0-preview.3.

The earlier draft suggested the Azure CLI '@<file>' convention as a
generic substitute for inline string args. The official docs only
document it for JSON parameters and the CLI source uses
'get_file_json' specifically, so the claim is removed and replaced
with an explicit warning not to rely on it for plain string args.

Files touched:
- skills/azure-devops-cli/SKILL.md: new 'Posting long comments on
  Windows' section with shell-detection table and three verified
  options.
- skills/azure-devops-cli/references/boards-and-iterations.md: short
  pointer at each --discussion example back to SKILL.md, plus an
  inline PowerShell snippet.

Closes #2061.

* azure-devops-cli: move long-comments guidance to reference file (#2061 review)

aaronpowell asked for the Windows long-comments section to live as a
reference file rather than inline in SKILL.md, so the token weight
isn't always loaded into the agent's context.

- Move the "Posting long comments on Windows" section to a new
  references/long-comments-on-windows.md verbatim.
- Strip the section from SKILL.md (56 fewer lines in the always-loaded
  surface).
- Add the new file to the Reference Files table in SKILL.md with a
  one-line "when to read" hint covering --discussion, --description,
  and --content failures on Windows.
- Update the two pointer comments in references/boards-and-iterations.md
  to point at the new reference file instead of the SKILL.md section.

docs/README.skills.md regenerated by 'npm run build' to pick up the
new reference file in the skill's bundled assets column.
2026-06-29 23:47:06 +00:00

6.0 KiB

Work Items, Area Paths & Iterations

Table of Contents


Work Items (Boards)

Query Work Items

# WIQL query
az boards query \
  --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] = 'Active'"

# Query with output format
az boards query --wiql "SELECT * FROM WorkItems" --output table

Show Work Item

az boards work-item show --id {work-item-id}
az boards work-item show --id {work-item-id} --open

Create Work Item

# Basic work item
az boards work-item create \
  --title "Fix login bug" \
  --type Bug \
  --assigned-to user@example.com \
  --description "Users cannot login with SSO"

# With area and iteration
az boards work-item create \
  --title "New feature" \
  --type "User Story" \
  --area "Project\\Area1" \
  --iteration "Project\\Sprint 1"

# With custom fields
az boards work-item create \
  --title "Task" \
  --type Task \
  --fields "Priority=1" "Severity=2"

# With discussion comment
az boards work-item create \
  --title "Issue" \
  --type Bug \
  --discussion "Initial investigation completed"

# For a long --discussion body on Windows, see references/long-comments-on-windows.md.
# Short version: use azps.ps1 in PowerShell, or fall back to 'az devops invoke'
# with --in-file when no native --file-path flag is available.

# Open in browser after creation
az boards work-item create --title "Bug" --type Bug --open

Update Work Item

# Update state, title, and assignee
az boards work-item update \
  --id {work-item-id} \
  --state "Active" \
  --title "Updated title" \
  --assigned-to user@example.com

# Move to different area
az boards work-item update \
  --id {work-item-id} \
  --area "{ProjectName}\\{Team}\\{Area}"

# Change iteration
az boards work-item update \
  --id {work-item-id} \
  --iteration "{ProjectName}\\Sprint 5"

# Add comment/discussion
az boards work-item update \
  --id {work-item-id} \
  --discussion "Work in progress"

# Long comment on Windows: read the body into a PowerShell variable and call
# azps.ps1 instead of az.cmd, or fall back to 'az devops invoke' with --in-file.
# Full guidance in references/long-comments-on-windows.md.
#
# PowerShell example:
#   $body = Get-Content -Raw .\comment.md
#   azps.ps1 boards work-item update --id 1234 --discussion $body

# Update with custom fields
az boards work-item update \
  --id {work-item-id} \
  --fields "Priority=1" "StoryPoints=5"

Delete Work Item

# Soft delete (can be restored)
az boards work-item delete --id {work-item-id} --yes

# Permanent delete
az boards work-item delete --id {work-item-id} --destroy --yes

Work Item Relations

# List relations
az boards work-item relation list --id {work-item-id}

# List supported relation types
az boards work-item relation list-type

# Add relation
az boards work-item relation add --id {work-item-id} --relation-type parent --target-id {parent-id}

# Remove relation
az boards work-item relation remove --id {work-item-id} --relation-id {relation-id}

Area Paths

List Areas for Project

az boards area project list --project {project}
az boards area project show --path "Project\\Area1" --project {project}

Create Area

az boards area project create --path "Project\\NewArea" --project {project}

Update Area

az boards area project update \
  --path "Project\\OldArea" \
  --new-path "Project\\UpdatedArea" \
  --project {project}

Delete Area

az boards area project delete --path "Project\\AreaToDelete" --project {project} --yes

Area Team Management

# List areas for team
az boards area team list --team {team-name} --project {project}

# Add area to team
az boards area team add \
  --team {team-name} \
  --path "Project\\NewArea" \
  --project {project}

# Remove area from team
az boards area team remove \
  --team {team-name} \
  --path "Project\\AreaToRemove" \
  --project {project}

# Update team area
az boards area team update \
  --team {team-name} \
  --path "Project\\Area" \
  --project {project} \
  --include-sub-areas true

Iterations

List Iterations for Project

az boards iteration project list --project {project}
az boards iteration project show --path "Project\\Sprint 1" --project {project}

Create Iteration

az boards iteration project create --path "Project\\Sprint 1" --project {project}

Update Iteration

az boards iteration project update \
  --path "Project\\OldSprint" \
  --new-path "Project\\NewSprint" \
  --project {project}

Delete Iteration

az boards iteration project delete --path "Project\\OldSprint" --project {project} --yes

Team Iterations

# List iterations for team
az boards iteration team list --team {team-name} --project {project}

# Add iteration to team
az boards iteration team add \
  --team {team-name} \
  --path "Project\\Sprint 1" \
  --project {project}

# Remove iteration from team
az boards iteration team remove \
  --team {team-name} \
  --path "Project\\Sprint 1" \
  --project {project}

# List work items in iteration
az boards iteration team list-work-items \
  --team {team-name} \
  --path "Project\\Sprint 1" \
  --project {project}

Default & Backlog Iterations

# Set default iteration for team
az boards iteration team set-default-iteration \
  --team {team-name} \
  --path "Project\\Sprint 1" \
  --project {project}

# Show default iteration
az boards iteration team show-default-iteration \
  --team {team-name} \
  --project {project}

# Set backlog iteration for team
az boards iteration team set-backlog-iteration \
  --team {team-name} \
  --path "Project\\Sprint 1" \
  --project {project}

# Show backlog iteration
az boards iteration team show-backlog-iteration \
  --team {team-name} \
  --project {project}

# Show current iteration
az boards iteration team show --team {team-name} --project {project} --timeframe current