Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Last active June 13, 2019 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskuech/65627f6e2c374b5d9ed3a487a4b1f2c2 to your computer and use it in GitHub Desktop.
Save chriskuech/65627f6e2c374b5d9ed3a487a4b1f2c2 to your computer and use it in GitHub Desktop.
# 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