-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
This issue tracks the implementation of the azdo boards work-item list command.
Command Description
List work items belonging to a project within an Azure DevOps organization. Work items are the fundamental units used to plan and track work in Azure Boards (tasks, bugs, user stories, etc.), and the REST API supports retrieving up to 200 items per call (Work Items - List (REST 7.1)). This command provides an ergonomic way to view the project backlog and quickly filter the results by workflow status, classification/severity, assignee, and other backlog attributes without having to author WIQL manually.
Important REST constraints:
- The “Work Items - List” endpoint fetches work items by ID (max 200 IDs). It does not list a project backlog by itself.
- To list work items by criteria, the command should run a WIQL query to obtain IDs, then fetch work items in batches.
Command Signature
azdo boards work-item list [ORGANIZATION/]PROJECT
- Aliases:
ls,l - Positional parsing must follow the standard project-scoped
[ORGANIZATION/]PROJECTsplitter. When the organization segment is omitted, resolve it via the configured default. Return a flag error when no organization is provided or configured.
Flags
--status,-s: Repeatable flag that accepts the state categoriesopen,closed,resolved,all. Convert the shorthand into WIQL filters usingSystem.StateCategory(open→ Proposed/InProgress,closed→ Completed/Removed,resolved→ Resolved). Default isopen.--type,-t: Repeatable flag for one or more work item types (e.g.,User Story,Task). Build a WIQL predicate onSystem.WorkItemType. When omitted, do not filter by type.--assigned-to,-a: Repeatable flag that accepts the same values supported by pull request reviewer resolution (email,org/team, descriptor). Also accept the special token@meto scope to the authenticated user (see Identity-based queries). Resolve identities using the same helpers asinternal/cmd/pr/create(identity client lookups) and map@meviaextensions.Client.GetSelfID.--classification,-c: Repeatable flag that filters on the severity classificationMicrosoft.VSTS.Common.Severity. Accept the canonical values documented for bug severity (1 - Critical,2 - High,3 - Medium,4 - Low) and emit a flag error for unknown values (Severity guidance).--priority,-p: Repeatable flag that filters onMicrosoft.VSTS.Common.Priority. Accept integer values 1–4 as defined in Azure Boards planning guidance (Priority field reference).--area: Repeatable flag that filters work items assigned to matching area paths. Accept either a fully-qualified area path or theUnder:prefix to include an entire subtree (e.g.,Under:Web/Payments). Map toSystem.AreaPath/Underoperators per Classification field reference.--iteration: Repeatable flag that filters by iteration (sprint) path. Accept the same syntax as--area, includingUnder:semantics. Map toSystem.IterationPath/Underoperators per the same classification guidance.--limit,-L: Maximum number of results to return (>=1).- Apply
$topto WIQL. - Fetch work items via
GetWorkItemsBatchin chunks of 200 IDs (hard REST limit). - Default 50.
- Apply
- JSON output flags: call
util.AddJSONFlags(cmd, &opts.exporter, []string{...})so callers can select top-level fields.- JSON output should emit the SDK work item model (
id,rev,fields,relations,url,_links) and only use an augmented struct if derived/related fields are added.
- JSON output should emit the SDK work item model (
Implementation Notes (filled checklist)
- Implement command: internal/cmd/boards/workitem/list/list.go (type opts struct, NewCmd(ctx), run(ctx, opts)).
- Wire command: internal/cmd/boards/workitem/workitem.go must AddCommand(list.NewCmd(ctx)) and be reachable from azdo boards.
- Parse project scope: util.ParseProjectScope(ctx, scopeArg); wrap parse errors with util.FlagErrorWrap.
- Clients:
- Work Item Tracking: ctx.ClientFactory().WorkItemTracking(ctx.Context(), scope.Organization) using QueryByWiql and GetWorkItemsBatch.
- Identity / Extensions clients only if required by flags (--assigned-to, @me).
- Progress: ios.StartProgressIndicator(); defer ios.StopProgressIndicator() and stop before printing.
- Query algorithm:
- Build WIQL query from flags.
- QueryByWiql to get work item references (IDs).
- Batch-fetch details via GetWorkItemsBatch (chunk size 200).
- Output:
- Table: ctx.Printer("table") with stable columns (e.g., ID, TYPE, STATE, TITLE, ASSIGNED TO, AREA, ITERATION).
- JSON: emit SDK work item model; register selected top-level fields with util.AddJSONFlags.
- Tests:
- Add internal/cmd/boards/workitem/list/list_test.go.
- Hermetic mocks: WorkItemTracking + any identity/extensions clients used.
- Table-driven cases for each filter + @me resolution + chunking at 200.
References
Metadata
Metadata
Assignees
Labels
No labels