use of jetbrains.buildServer.server.rest.model.problem.scope.ProblemOccurrencesTree in project teamcity-rest by JetBrains.
the class ChangeRequest method getChangeProblemsTree.
/**
* Experimental, subject to change
* @since 2021.2
*/
@GET
@Path("/{changeLocator}/problemsTree")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get problems tree for the matching change.", nickname = "getChangeProblemsTree", hidden = true)
public ProblemOccurrencesTree getChangeProblemsTree(@ApiParam(format = LocatorName.CHANGE) @PathParam("changeLocator") String changeLocator, // todo: remove after ui migration
@QueryParam(ProblemOccurrencesTreeCollector.SUB_TREE_ROOT_ID) String subTreeRootId, @QueryParam("treeLocator") String treeLocatorText, @QueryParam("fields") String fields) {
final SVcsModification change = myChangeFinder.getItem(changeLocator).getSVcsModification();
ChangeStatusProvider myStatusProvider = myServiceLocator.getSingletonService(ChangeStatusProvider.class);
ChangeStatus changeStatus = myStatusProvider.getMergedChangeStatus(change);
Stream<BuildPromotion> firstBuildsPromotions = changeStatus.getBuildTypesStatusMap().values().stream().filter(Objects::nonNull);
Locator treeLocator = Locator.createPotentiallyEmptyLocator(treeLocatorText);
if (subTreeRootId != null) {
treeLocator.setDimension(ProblemOccurrencesTreeCollector.SUB_TREE_ROOT_ID, subTreeRootId);
}
return new ProblemOccurrencesTree(myProblemOccurrencesTreeCollector.getTreeFromBuildPromotions(firstBuildsPromotions, treeLocator), new Fields(fields), myBeanContext);
}
Aggregations