API to get build failure count directly


Is there any optimal methods to get all the build failures for the builds configured in TeamCity?

Currently I am getting this information by iterating through all builds for a given date range.

List<SBuildType> activeBuildTypes = projectManager.getActiveBuildTypes(); //jetbrains.buildServer.serverSide.ProjectManager

After that we iterate activeBuildTypes and take getHistory() of the build type.
From this we get the SFinishedBuild object and from that get the status (ie whether build failure or compilation failure).

As there are a huge number of builds, all these process takes a long time to complete.

It will be good if we are getting an API for getting the count of build failures, compilation failures, test failures.

Is there any API's available currently?

Any help will be appreciated

thanks in advance.

Comment actions Permalink

We recommend to use getEntriesSince method of BuildHistory service.
Such way you can cache results and don't process the same builds twice.


Comment actions Permalink

Thanks for reply ...

but is there any way to get the build failure count, compilation error count, test failure count etc directly with the help of any direct methods?
Whether this method is helpful in that aspect?
As per API doc  getEntriesSince returns builds of the specified configuration started after the specified  build..

thank you


Please sign in to leave a comment.