Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#
Tip/Trick

Team Foundation Server (TFS) Build Comments Finder

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
17 Feb 2010CPOL 26.9K   2  
This utility is used to find the comments entered by users in TFS while check in the code. This will give change set number with owner, date of check in, comments and check in notes.So this will used in finding all checkin comments from TFS for any project. //Create object of tfs...
This utility is used to find the comments entered by users in TFS while check in the code.

This will give change set number with owner, date of check in, comments and check in notes.

So this will used in finding all checkin comments from TFS for any project.
C#
//Create object of tfs
//Need to add server address, user ID, password and domain Name
TeamFoundationServer tfs = new TeamFoundationServer("<ServerAddress>",
   new NetworkCredential("<UserID>","<Password>", "<DomainName>"));
// Get a reference to Version Control.
Type type = typeof(VersionControlServer);
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(type);
//Need to add application path
IEnumerable changeSets = versionControl.QueryHistory(@"<ApplicationPath>",
    VersionSpec.Latest, 0, RecursionType.Full,
    null, null, null, 5000, true, false);

int i =-1;
foreach(Changeset data in changeSets)
{
    i++;
    this.dgvComment.Rows.Add();
    this.dgvComment.Rows[i].Cells["ChangeSetNo"].Value = data.ChangesetId.ToString();
    this.dgvComment.Rows[i].Cells["Owner"].Value = data.Owner;
    this.dgvComment.Rows[i].Cells["Date"].Value = data.CreationDate.Date;
    this.dgvComment.Rows[i].Cells["Comments"].Value = data.Comment;
    this.dgvComment.Rows[i].Cells["CheckinNote"].Value = data.CheckinNote;
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --