TFS 2017 - Show Tags in List of Builds

474 Views Asked by At

Our team is quite used to the build quality value in TFS 2015 and earlier XAML builds. This is not possible with the new Build & Release, but we can add tags to a build. However, they are not shown in the list of builds, we can only filter by tags in the build definition history (which shows a list of builds). Is there anyway to configure this to show tags for builds? Or any other way to show the tags in a list of builds?

We can use REST API to get these values back, is there a way to modify the web pages or add our own?

Note - we did NOT install SharePoint so we can't use that.

1

There are 1 best solutions below

3
On

There isn't a way to configure to show tags for builds, it's not supported.

There is a User Voice here to suggest the feature, you can go and vote it up to achieve it in future.

As a workaround, you can list the tags with build tags REST API, then filter the builds by tags just as you did.

Another way is retrieving the build list with tags using REST API.

For example, you can use below PowerShell script to get the build list with tags and export the build list to a .csv file.

$Collection = "http://server:8080/tfs/DefaultCollection"
$teamproject = "ProjectName"
$baseUrl = "$Collection/$teamproject/_apis/build/builds?api-version=2.0"        
$builds = (Invoke-RestMethod -Uri $baseUrl -Method Get -UseDefaultCredential).value

$BuildResults = @()

foreach($build in $builds){

    $customObject = new-object PSObject -property @{
          "BuildDefinition" = $build.definition.name
          "BuildId" = $build.id
          "BuildNumber" = $build.buildNumber
          "status" = $build.status
          "result" = $build.result
          "finishTime" = $build.finishTime
          "sourceBranch" = $build.sourceBranch
          "sourceVersion" = $build.sourceVersion 
          "tags" = @($build.tags -join ',')|Select-Object
          "RequestedFor" = $build.requestedFor.displayName 
        } 

    $BuildResults += $customObject      
}

$BuildResults | Select `
                BuildDefinition,
                BuildId, 
                BuildNumber, 
                status,
                result,
                finishTime,
                sourceBranch,
                sourceVersion,
                tags,
                RequestedFor|export-csv -Path E:\user\$teamproject-Build.csv -NoTypeInformation

enter image description here