use of jetbrains.buildServer.serverSide.BuildPromotion in project teamcity-rest by JetBrains.
the class ChangeRequest method getDeployments.
/**
* Experimental support only!
*/
@GET
@Path("/{changeLocator}/deployments")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get deployments with this change.", nickname = "getDeployments", hidden = true)
public Builds getDeployments(@ApiParam(format = LocatorName.CHANGE) @PathParam("changeLocator") String changeLocator, @QueryParam("fields") String fields) {
final SVcsModification change = myChangeFinder.getItem(changeLocator).getSVcsModification();
ChangeStatusProvider myStatusProvider = myServiceLocator.getSingletonService(ChangeStatusProvider.class);
ChangeStatus changeStatus = myStatusProvider.getMergedChangeStatus(change);
List<BuildPromotion> promotions = changeStatus.getDeploymentStatus().values().stream().filter(Objects::nonNull).collect(Collectors.toList());
return Builds.createFromBuildPromotions(promotions, null, new Fields(fields), myBeanContext);
}
Aggregations