3

I would like to search for tfs changeset comment in visual studio 2017. Any way or tools except "View history and copy all to excel and search"?

Thanks.

mintssoul
  • 51
  • 1
  • 10

2 Answers2

4

Update for us people still using TFS: use the VS 2017 Extension "Find Changeset By Comment 2017" https://marketplace.visualstudio.com/items?itemName=TheDan.FindChangesetByComment

Then you get this right-click menu item in Source Control Explorer: enter image description here

blalond
  • 875
  • 10
  • 17
  • Can you [edit] your answer to include a brief description of the extension, how it works, and how it solves the problem? This would help to ensure that your answer will not be deleted. Please see: https://meta.stackoverflow.com/questions/251602/recommending-off-site-resources-when-questions-dont-ask-for-it/251605#251605 – Cody Gray - on strike Feb 11 '19 at 19:56
0

Try below PowerShell script, just replace the search text 07 as your own behind like '*07*'

$baseUrl = "http://server:8080/tfs/DefaultCollection/_apis/tfvc/changesets?maxCommentLength=30&api-version=1.0"         
$changesets = (Invoke-RestMethod -Uri $baseUrl -Method Get -UseDefaultCredential).value|where({$_.comment -like '*07*'})

$changesetResults = @()

foreach($changeset in $changesets){

    $customObject = new-object PSObject -property @{
          "changesetId" = $changeset.changesetId
          "author" = $changeset.author.uniqueName
          "checkedInBy" = $changeset.checkedInBy.uniqueName
          "createdDate" = $changeset.createdDate
          "comment" = $changeset.comment
        } 

    $changesetResults += $customObject      
}

$changesetResults | Select `
                changesetId, 
                author, 
                checkedInBy,
                createdDate,
                comment #|export-csv -Path C:\Changesets.csv -NoTypeInformation

enter image description here


If you are using VS client, you can also use below extensions to search with comments:

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • 3
    Nothing says "great source control system" like not having basic search features. – A.R. Sep 07 '18 at 14:34