Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom TFS CheckinNoteDefinitions?

Using TFS 2012 client C# API, I can add CheckinNotes to each commit; CheckinNotes need a suitable CheckinNoteFieldDefinition for each CheckinNoteFieldValue, or the checkin will be rejected and an exception is thrown.

How can I add additional (custom) CheckinNoteFieldDefinitions to the tfs server?

I am not really getting any useful information out of the MSDN documentation.

Related MSDN links:

  • CheckinNoteFieldValue
  • CheckinNoteFieldDefinition
like image 834
Wilbert Avatar asked Dec 12 '25 20:12

Wilbert


1 Answers

It's created dynamically by the server once you check-in with any custom check-in notes:

var checkinNoteFieldValues = new[]
{
    new CheckinNoteFieldValue("Custom Note", "some value"),
    new CheckinNoteFieldValue("Other Note", "other value")
};
var checkinNote = new CheckinNote(checkinNoteFieldValues);
var pendingChanges = workspace.GetPendingChanges(); // workspace is Microsoft.TeamFoundation.VersionControl.Client.Workspace
workspace.CheckIn(pendingChanges, "comment", checkinNote, null, null); // checkinNote will trigger a new CheckinNoteFieldDefinition 
like image 116
KMoraz Avatar answered Dec 14 '25 10:12

KMoraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!