Skip to content

feat: Implement azdo boards iteration project list command #144

@tmeckel

Description

@tmeckel

Track implementation of the azdo boards iteration project list command.

Command Description

List the iteration (sprint) hierarchy for a project within an Azure DevOps organization. Iteration paths classify work by schedule and expose optional start/finish dates, all retrieved through the Work Item Tracking Classification Nodes REST API.

Command Signature

azdo boards iteration project list [organization/]<project>
  • Aliases: ls, l
  • Positional argument follows [organization/]<project> parsing rules with default organization fallback.

Flags

  • --path, -p: Optional iteration path relative to the project root. When set, treat the node as the root for listing.
  • --depth, -d: Optional integer (1–10) limiting depth. Default 3. Maps to $depth.
  • --include-dates: Optional bool. When enabled, surface Start Date and Finish Date columns sourced from node attributes.
  • JSON export flags wired via util.AddJSONFlags.

Behavior

  1. Resolve streams, parse [organization/]<project>, and start/stop the progress indicator around API calls.
  2. Acquire the Work Item Tracking client and call classificationnodes/Iterations using either GetClassificationNodes (root listing) or GetClassificationNode (scoped path) with $depth.
  3. Flatten the returned tree depth-first. For each node capture: Name, fully-qualified Path, HasChildren, Level, and optionally StartDate/FinishDate. The Path must remain untouched so users can copy it directly into azdo boards work-item list --iteration.
  4. When JSON export requested, emit an object with json:"nodes" containing the ordered list. Each node entry must expose a path field so scripts can feed the value to --iteration without parsing table text. Include date pointers with omitempty when requested.
  5. Default path outputs a table via ctx.Printer("list") with columns Name, Path, Level, Has Children, plus date columns when --include-dates is set. Use indentation prefixes to illustrate hierarchy while keeping the Path column intact.
  6. Validate --depth bounds and surface descriptive errors for invalid paths or client failures.

Testing

  • Cover root listing, scoped path listing, depth truncation, JSON export (assert path presence), and error propagation using classification node mocks.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions