TFS 2013 Global List build items have extra slash

92 Views Asked by At

In TFS 2013, builds get entered like this in the global list:

(build definition)/(version)

whereas before in TFS 2010 they were like this:

(version)

This is causing a big headache for us, the only way we have found to fix this is to manually edit each build list item after each build.

1

There are 1 best solutions below

1
On BEST ANSWER

I think this is by design. As a workaround you can write a script which will update this for you. E.g. in PowerShell:

$filePath = "$env:TEMP\gl.xml"
$collectionUrl = "http://<server name>:8080/tfs/<collection name>"
$vsPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 12.0\Common7\IDE"

& (Join-Path $vsPath -ChildPath "witadmin.exe") exportgloballist /collection:$collectionUrl /f:$filePath

$gl = [xml](Get-content $filePath)

foreach ($list in $gl.GLOBALLISTS.GLOBALLIST) 
{
    if($list.name.StartsWith("Builds"))
    {
        "Found " + $list.name
        foreach($item in $list.LISTITEM)
        {
            if($item.value.Contains("/"))
            {
                $item.value = $item.value.Substring($item.value.IndexOf("/") + 1)
            }
        }   
    }
}

$gl.Save($filePath)

& (Join-Path $vsPath -ChildPath "witadmin.exe") importgloballist /collection:$collectionUrl /f:$filePath