2014-02-10 42 views
10

是否有一个REST API端点,以获得变化的集合被等待在TeamCity的构建?TeamCity的REST API获得的挂起的更改列表

我们构建设置为手动,它是引发TeamCity的外面,想展现子弹点列表的承诺说会是在构建。

在用户界面,您可以在“挂起的更改(X)”标签下看到这一点。

我找不到这样做的任何例子,我已经找到了最接近的是:

http://<server>/httpAuth/app/rest/changes/buildType:<build type id> 

这似乎是虽然返回了最后的修改。

以前有人做过这个吗?

回答

3

我在周围的工作的一种方式最终解决方案是:

从我的数据库查找最新的变化ID的构建TeamCity的以外(我想你可以查询TeamCity的API来找到最后成功构建和从那里)

把它然后调用:

http://<server>/httpAuth/app/rest/changes?buildId=id:<build id>&sinceChange=id:<last change id> 

然后取出从该列表中的每个单独的变化。

一种解决办法了一点,但我看不出反正否则得到的挂起的更改列表。

13

我刚刚找到工作的解决方案由于这个问题。如果其他人正在寻找完整的解决方案,我会在这里展示它:

您需要知道您想要获取待执行更改的构建的buildTypeId。在这种情况下可以说buildTypeId=bt85

1 
    http://<server>/httpAuth/app/rest/buildTypes/id:bt85/builds/ 
    // Get the last build from the XML returned. 
    // Lets say last build id = 14000 

2 

    http://<server>/httpAuth/app/rest/changes?build=id:14000 
    // The newest change returned is the one you need. 
    // Lets say newest change id = 15000 

3 

    http://<server>/httpAuth/app/rest/changes?buildType=id:bt85&sinceChange=15000 
    // You're now looking at the pending changes list of the buildType bt85 
+0

不幸的是,最新的版本可能没有任何变化,然后这个方法中断。实际上应该有一种方法来获得任何“待定更改”列表。 – laughingbovine

+0

修订我之前的评论... 如果有问题的编译型具有零建立,那么这种方法休息。一定要检查这种情况。 – laughingbovine

相关问题