Api TeamCity:如何获取当前未运行的每个构建配置的最后构建列表?

Api TeamCity:如何获取当前未运行的每个构建配置的最后构建列表?,api,rest,teamcity,Api,Rest,Teamcity,我正在使用TeamCity 7.1。我想获得一个列表,其中包括当前未运行的每个生成配置(生成类型)的最后一个生成。我发现了这个问题:但答案中的其余URI对我来说并不适用 <teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:failure) /httpAuth/app/rest/builds?locator=sinceBuild:(状态:失败) 似乎工作,并给我所有的建设,成功后失败之前 但恰

我正在使用TeamCity 7.1。我想获得一个列表,其中包括当前未运行的每个生成配置(生成类型)的最后一个生成。我发现了这个问题:但答案中的其余URI对我来说并不适用

<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:failure) 
/httpAuth/app/rest/builds?locator=sinceBuild:(状态:失败)
似乎工作,并给我所有的建设,成功后失败之前

但恰恰相反

<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:success)
/httpAuth/app/rest/builds?locator=sinceBuild:(状态:成功)
不返回任何生成

我知道我可以获取所有构建类型,迭代它们,并使用

<teamcity-server>/httpAuth/app/rest/buildTypes/id:<build-type-id>/builds/running:false?count=1&start=0 
/httpAuth/app/rest/buildTypes/id:/builds/running:false?count=1&start=0
(“计数=1&开始=0”可能不是必需的) 但是我不确定我得到的是不是最新的版本。这还需要对所有构建类型进行许多REST调用。一个简洁的解决方案将只使用一个REST调用

有什么想法吗?

根据,可以通过以下任一方式定位构建:

<teamcity-server>/httpAuth/app/rest/buildTypes/id:<build-type-id>/builds/running:false,status:success
/httpAuth/app/rest/buildTypes/id:/builds/running:false,状态:success

/httpAuth/app/rest/builds/running:false,状态:success
如果您试图在buildType下查询某些内容,并且
可以是id:或name:
(引用自文档),则必须根据当前REST API将buildType的后缀设置为
。因此,必须指定生成id或生成名称

但是,正如您所期望的那样,理想的方式是:

<teamcity-server>/httpAuth/app/rest/buildTypes/builds/running:false,status:success
/httpAuth/app/rest/buildTypes/builds/running:false,状态:success

也许你可以在我看来提出这个问题。

我试过了,两个都是
/httpAuth/app/rest/builds?locator=sinceBuild:(状态:失败)
/httpAuth/app/rest/builds?locator=sinceBuild:(状态:成功)
,它们都在工作。第二个可能不适用于您,因为在上次成功生成之后,您可能没有任何生成。然后它将返回0计数。总的来说,它们中的任何一个都会给你一个0计数,因为你的上一次生成要么成功,要么失败。这不会得到最后一次完成的生成,而是所有生成。
<teamcity-server>/httpAuth/app/rest/buildTypes/builds/running:false,status:success