use of jetbrains.buildServer.serverSide.userChanges.CanceledInfo in project teamcity-rest by JetBrains.
the class Build method getCanceledComment.
public static Comment getCanceledComment(@NotNull final SBuild build, @NotNull final Fields fields, @NotNull final BeanContext context) {
final CanceledInfo canceledInfo = build.getCanceledInfo();
if (canceledInfo == null)
return null;
jetbrains.buildServer.users.User user = null;
if (canceledInfo.isCanceledByUser()) {
final Long userId = canceledInfo.getUserId();
assert userId != null;
user = context.getSingletonService(UserModel.class).findUserById(userId);
}
// todo: returns wrong date after server restart!
return new Comment(user, new Date(canceledInfo.getCreatedAt()), canceledInfo.getComment(), fields, context);
}
Aggregations