如何在teamcity中使用特定的vcs编号从REST API正确触发构建?

如何在teamcity中使用特定的vcs编号从REST API正确触发构建?,teamcity,teamcity-rest-api,Teamcity,Teamcity Rest Api,我正在开发一个C工具,用TeamCity的RESTAPI触发构建。我想用特定的vcs编号触发构建,所以我要做的是: POST => teamcity-server/httpAuth/app/rest/buildQueue HEADER => basicAuthCredentials BODY => <build> <buildType id="SomeValidBuildId"/> <properties>

我正在开发一个C工具,用TeamCity的RESTAPI触发构建。我想用特定的vcs编号触发构建,所以我要做的是:

POST => teamcity-server/httpAuth/app/rest/buildQueue 
HEADER => basicAuthCredentials
BODY => 

<build>
    <buildType id="SomeValidBuildId"/>
    <properties>
        <property name="SAMPLE_TEST" value="VERY_TESTY"/>
    </properties>
    <lastChanges>
        <change locator="version:4354174,buildType:(id:SomeValidBuildId)" />
    </lastChanges>
</build>

构建可以访问VcsRoot设置及其所需的一切,如何在以前从未构建过的vcs编号上触发自定义构建?

当TeamCity尚未检测到传递版本的更改时,您会收到错误响应,TeamCity需要检测更改,然后才能将其用于构建。您可以在更改发生时立即通知TeamCity,或者在尝试触发构建之前调用提交挂钩URL。在接收到提交钩子请求和检测到的更改之间仍然会有一些延迟,通常是几秒钟,因此等待一段时间然后触发生成是有意义的。

我们使用的是Performce扩展,我们从TeamCity获得了一个以前从未生成过的挂起更改列表,那么它已经在TeamCity了/
Http request failed: 
error : Responding with error, status code: 404 (Not Found).
error : Details: jetbrains.buildServer.server.rest.errors.NotFoundException: Nothing is 
found by locator 'version:4354174,buildType:(id:SomeValidBuildId),count:1'.
error : Could not find the entity requested. Check the reference is correct and the user has permissions to access the entity.