I want to create gated.checkins programmatically.I have a custom build template.I can create build successfully but when I want to open created build definition from visual studio that time In Process tab selected template comes empty but if I go and selected my custom template that time I can see all my property's and configurations .
var newBuildDefinition =
buildServer.CreateBuildDefinition(TeamProject);
newBuildDefinition.Name = GatedName;
newBuildDefinition.Description = TFSConstantEnums.AutomaticGatedCreationDescription;
newBuildDefinition.ContinuousIntegrationType = ContinuousIntegrationType.All;
newBuildDefinition.QueueStatus = DefinitionQueueStatus.Enabled;
newBuildDefinition.TriggerType = triggerType;
// ..........................
newBuildDefinition.BuildController = Controllers(buildServer).FirstOrDefault();
var GatedTemplate = buildServer.QueryProcessTemplates(ConstantEnums.BuildProcessTemplateTeamProject).Where(p
=> p.ServerPath.Contains(ProcessTemplateName)).First();
newBuildDefinition.Process = GatedTemplate; //In here my custom template come and I can set it