How to get previous buildResults
Moti Wertheimer (189●1●36●28)
| asked Jun 13 '13, 5:12 a.m.
JAZZ DEVELOPER edited Jun 13 '13, 11:24 a.m. by Ralph Schoon (63.5k●3●36●46)
Hi,
Using Java client I can get IBuildResult instance using the Query model. Now I want to get the build before this build. I see a way to do it using IBuildResultStatusTrend::getPreviousBuilds But I have no access to this class using the Client (If I am not wrong). Is there a way to get the previous builds out of a given build? |
Accepted answer
Lauren Hayward Schaefer (3.3k●1●17●27)
| answered Jun 17 '13, 6:45 a.m.
JAZZ DEVELOPER edited Jun 17 '13, 6:47 a.m.
Regarding Moti's comment above about getting the build results out of the build definition: It is possible to get the build results from the build definition. I'm including a method below that queries for a specific build using a label and build definition, but you could pull out the code related to the label:
public IBuildResult queryForBuildUsingLabelAndBuildDefinition(String label, String buildDefinitionId, ITeamRepository teamRepository) throws TeamRepositoryException { IBuildResultQueryModel buildResultQueryModel = IBuildResultQueryModel.ROOT; Moti Wertheimer selected this answer as the correct answer
Comments
I used it to get the list of all builds in dsc order, iterating it lets me find the previous build.
Thanks,
Moti
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Not sure if that will help, but I think you should be able to get the build definition and thenĀ all the build results for it. I would try that.
Thanks Ralph,