use of jetbrains.buildServer.serverSide.impl.audit.filters.ActionTypesFilter in project teamcity-rest by JetBrains.
the class Build method getStatusChangeComment.
/**
* This is a temporary workaround, will be removed in the future versions
*/
@XmlElement
public Comment getStatusChangeComment() {
return ValueWithDefault.decideDefault(myFields.isIncluded("statusChangeComment", false, false), () -> {
// can improve the code by requesting only 1 item
final List<AuditLogAction> logActions = ((BuildPromotionEx) myBuildPromotion).getAuditLogActions(new ActionTypesFilter(ActionType.BUILD_MARKED_AS_FAILED, ActionType.BUILD_MARKED_AS_SUCCESSFUL));
if (logActions.isEmpty())
return null;
// the most recent action
AuditLogAction action = logActions.get(0);
return new Comment(action.getComment(), myFields.getNestedField("statusChangeComment", Fields.NONE, Fields.LONG), myBeanContext);
});
}
Aggregations