What you need to know to use the Process Template API

Developing an application using the Team Foundation Server Process Template feature is not an easy task, mainly because of the lack of documentation and sample around it. As I had to deal with it when writing the WITSynchronizer I guess I can share some experience out there. Using the IProcessTemplates interface Let’s start by the beginning, you have your Team Foundation Server object and want to get the IProcessTemplates interface. The GetService() method can do that for you: // Get the Process Template interface IProcessTemplates ptp = (IProcessTemplates)tfs.GetService(typeof(IProcessTemplates)); The MSDN documentation about this interface is pretty much the list of its members, so let’s describe a bit more what you can do with them. int AddTemplate(string name, string description, string metadata, string state) This method is used to add a new Process Template in your TFS, it’s only the declaration of the new Process Template, the content will have to be upload with another method. name: the name of your Process Template (the one you see in the combo box when creating a new Team Project) description: the description of your Process Template (the one you see in the description field when creating a new Team Project) metadata: the “OuterXML” […]