【问题标题】:Is there a way to find all item (Product Backlog Item, Bugs, Task) without any Tags included? (With Query)有没有办法在不包含任何标签的情况下找到所有项目(产品积压项目、错误、任务)? (带查询)
【发布时间】:2019-05-05 21:22:25
【问题描述】:

我正在整个项目中进行查询,并希望找到所有没有任何标签的项目。有什么办法吗?

【问题讨论】:

标签: tfs azure-devops


【解决方案1】:

是否可以查询所有没有标签的工作项。

有一个关于它的功能请求here

作为解决方法,您可以为所有未标记的工作项添加特定标记以标记它们,然后查询此标记。

您可以使用 Rest API 获取工作项,然后过滤结果以获取未标记的工作项。

PowerShell 中的小脚本:

$user = ""
$token = "YOUR-PAT-HERE"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user, $token)))
$url = "https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql/{queryGuid}?api-version=5.0"
$workItems = Invoke-RestMethod -Uri $url -Method Get -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}

Write-Host "Work Items without Tags:"
$workItems.workItems.ForEach({
  $url = "https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/$($_.id)?api-version=5.0"
  $workItemDetails = Invoke-RestMethod -Uri $url -Method Get -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
  if($workItemDetails.fields.'System.Tags' -eq $null
  { Write-Host $_.id }
}) 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-12
    • 2012-07-16
    • 1970-01-01
    • 2017-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    相关资源
    最近更新 更多