Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# constant parameters
$org = "MyAzureDevOpsOrgName"
$project = "MyAzureDevOpsProjectName"
$areaPath = "/the/area/path/containing/my/work/items"
$tag = "the-tag-that-identifies-work-items-as-automanaged"
$query = @"
SELECT *
FROM WorkItems
WHERE [Tags] CONTAINS '$tag'
AND [System.AreaPath] == '$areaPath'
"@
<#
.SYNOPSIS
List the automatically managed work items in Azure Boards
#>
function Get-WorkItems {
az boards query `
--org "https://dev.azure.com/$org" `
--project $project `
--wiql ($query -replace "\s+", " ").Trim() `
| ConvertFrom-Json
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment