engg
engg

Reputation: 341

Enforce a particular check-in comment syntax

I have made check-in comments mandatory in Team Foundation Server 2012. Now I need to enforce each check-in comment is in this format:

[JIRA-1234] testing TFS checkins

  1. Left square bracket
  2. JIRA ticket number (a plus if this ticket number can be validated)
  3. Right square bracket
  4. A string briefly describing the change.

Is creating a custom check-in policy the only way to achieve this or is their an alternative? Custom check-in policies are client-side. is there a server-side solution?

Upvotes: 1

Views: 417

Answers (1)

Dylan Smith
Dylan Smith

Reputation: 22235

You could create an ISubscriber plug-in that gets deployed to the TFS Server and runs server-side. ISubscriber plug-ins can subscribe to TFS Events (such as Check-In) and have custom code to respond appropriately.

Unfortunately, it doesn't give the opportunity to prevent the check-in, but you could send a notification to a dev lead/manager, or automatically roll-back the check-in.

More info on writing an ISubscriber here: http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/

Upvotes: 2

Related Questions