Build and execute WIQL (Work Item Query Language) queries for Azure DevOps. Use when the user wants to query work items, find bugs, list tasks, search by assignee, filter by state, find items in a sprint, or build custom work item queries. Use when user mentions "query", "find work items", "list bugs", "my tasks", "assigned to", "in sprint", or "WIQL".
/plugin marketplace add JoshuaRamirez/ms-ado-az-claude-code-plugin/plugin install ado-work-items@ms-ado-azThis skill inherits all available tools. When active, it can use any tool Claude has access to.
NO TOP CLAUSE - WIQL does NOT support SELECT TOP N like SQL Server. Limit results with shell:
az boards query --wiql "..." -o table | head -10
Use explicit project name - The @project macro is unreliable in CLI:
-- UNRELIABLE:
WHERE [System.TeamProject] = @project
-- RELIABLE:
WHERE [System.TeamProject] = 'YourProjectName'
Only flat queries supported - The CLI only supports flat queries, not tree/hierarchical queries.
NO LIKE OPERATOR - WIQL does NOT support SQL-style LIKE patterns. Use CONTAINS instead:
-- DOES NOT WORK:
WHERE [System.Title] LIKE '%keyword%'
-- USE THIS INSTEAD:
WHERE [System.Title] CONTAINS 'keyword'
CANNOT ORDER BY System.Parent - Sorting by parent ID is not supported:
-- DOES NOT WORK:
ORDER BY [System.Parent]
-- WORKAROUND: Filter by parent IDs with IN clause, sort client-side
WHERE [System.Parent] IN (1234, 1235, 1236) ORDER BY [System.Id]
az boards query --wiql "SELECT [fields] FROM workitems WHERE [conditions]" -o table
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM workitems WHERE [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.State] = 'In Progress' AND [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM workitems WHERE [System.WorkItemType] = 'Bug' AND [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.AssignedTo] = 'user@domain.com' AND [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title], [System.ChangedDate] FROM workitems WHERE [System.TeamProject] = 'ProjectName' ORDER BY [System.ChangedDate] DESC" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.IterationPath] = 'ProjectName\\Sprint 1' AND [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.AreaPath] UNDER 'ProjectName\\TeamArea'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM workitems WHERE [System.WorkItemType] = 'Task' AND [System.State] <> 'Done' AND [System.TeamProject] = 'ProjectName' ORDER BY [Microsoft.VSTS.Common.Priority]" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.Tags] CONTAINS 'urgent' AND [System.TeamProject] = 'ProjectName'" -o table
az boards query --wiql "SELECT [System.Id], [System.Title] FROM workitems WHERE [System.AssignedTo] = '' AND [System.State] = 'New' AND [System.TeamProject] = 'ProjectName'" -o table
| Field | Reference Name |
|---|---|
| ID | System.Id |
| Title | System.Title |
| State | System.State |
| Type | System.WorkItemType |
| Assigned To | System.AssignedTo |
| Created By | System.CreatedBy |
| Area | System.AreaPath |
| Iteration | System.IterationPath |
| Created | System.CreatedDate |
| Changed | System.ChangedDate |
| Priority | Microsoft.VSTS.Common.Priority |
| Severity | Microsoft.VSTS.Common.Severity |
| Tags | System.Tags |
| Story Points | Microsoft.VSTS.Scheduling.StoryPoints |
| Operator | Description | Example |
|---|---|---|
= | Equals | [System.State] = 'Active' |
<> | Not equals | [System.State] <> 'Closed' |
>, <, >=, <= | Comparison | [Microsoft.VSTS.Common.Priority] <= 2 |
CONTAINS | Contains text | [System.Tags] CONTAINS 'urgent' |
NOT CONTAINS | Does not contain | [System.Title] NOT CONTAINS 'test' |
IN | In list | [System.State] IN ('Active', 'New') |
NOT IN | Not in list | [System.State] NOT IN ('Closed', 'Removed') |
UNDER | Under path | [System.AreaPath] UNDER 'Project\Team' |
AND, OR | Logical operators | [A] = 'x' AND [B] = 'y' |
| Macro | Description | Reliability |
|---|---|---|
@Me | Current user | Usually works |
@Today | Today's date | Works |
@Today - N | N days ago | Works |
@project | Current project | UNRELIABLE - use explicit name |
@CurrentIteration | Current sprint | May not work in CLI |
-o table - Human readable table-o json - Full JSON output-o tsv - Tab-separated values'Active' not Active[System.State] not System.State'It''s working''Project\Team\SubArea' (double in bash: 'Project\\Team')[System.TeamProject] = 'Name' for reliable resultsSince ORDER BY [System.Parent] is not supported, use the IN clause to filter by parent:
# Find all children of specific parents
az boards query --wiql "SELECT [System.Id], [System.Title], [System.Parent] FROM WorkItems WHERE [System.Parent] IN (1234, 1235, 1236) AND [System.TeamProject] = 'ProjectName'" -o table
This works well for:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.