我相信TC 8.x和TC 9.x REST API非常相似。这个例子是为TC 9.x编写的。
我不知道你是否对此进行了整理,但(对于记录),你必须执行“创建具有所有设置的新构建配置”。基本上,你必须创建这样一个格式的XML:
<buildType id="YourBuildID" name="YourBuildName" projectId="TheProjectIDThatOwnsThis" >
<project id="TheProjectIDThatOwnsThis" name="TheProjectName" parentProjectId="TheProjectParent" href="TheProjectHREFValue" webUrl="TheWebURLOfTheProejct"
/>
<template id="TemplateID" name="TemplateName" templateFlag="true" projectName="ProjectThatHasTheTemplate" projectId="ProjectThatHasTheTemplate" href="TemplateHRef" />
<vcs-root-entries>
<!--vcs-root-entry elements are not necessary-->
</vcs-root-entries>
<settings>
</settings>
<parameters>
</parameters>
<steps>
</steps>
<features>
</features>
<triggers>
</triggers>
<snapshot-dependencies/>
<artifact-dependencies/>
<agent-requirements/>
<builds href="BuildConfigurationHREF" />
</buildType>
,做一个POST到这个网址:http://TCServerName:Port/httpAuth/app/rest/buildTypes
由TeamCity的期望的XML,所以它是由你在编程你将创建它的语言。我已经用C#/ LINQ到XML来完成这个工作,并且工作得很好。
希望这会有所帮助。