Shiry
Shiry

Reputation: 41

using TFS API, how can I Modify an existing changeset comment using TFS API

How can I modify an existing change set comment using the API? Using Visual Studio this can be done in the 'Changeset Details' window by changing the comment and clicking Save. How can it be done using the API?

Upvotes: 1

Views: 571

Answers (1)

Vicky - MSFT
Vicky - MSFT

Reputation: 5010

You need to run the following code:

TeamFoundationServer tfs = new TeamFoundationServer(new Uri("http://tfsservername:8080/tfs/DefaultCollection"));
VersionControlServer vcServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
Changeset changeset = vcServer.GetChangeset(changesetid);
changeset.Comment = changeset.Comment + Environment.NewLine + "your comment";
changeset.Update();

Upvotes: 1

Related Questions