export/import build definition from/to JSon file (TFS 2013)

Viewed 1153

I'm trying to export and import build definitions from tfs2013, following this link and this, but none of them are working for me. I know there are some plugins for tfs which do this, but I can't use any of them due to company policies restrictions.

GetDefinitionAsync and GetFullDefinitionsAsync methods are fine, but they don't retrieve ProcessParameters property, so I can't export a full build definition which includes this important information. I've tried to get this property calling IBuildServer.QueryBuildDefinitions, but when I try to create new build definition I can't because the data type is Microsoft.TeamFoundation.Build.Client.IBuildDefinition and I can't create new instance of Microsoft.TeamFoundation.Build.Client.BuildDefinition due to it's a sealed class. how can I copy ProcessParameters and the other info to import the full build definition?

Thanks

2 Answers
Related