Search in sources :

Example 1 with CanceledInfo

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);
}
Also used : CanceledInfo(jetbrains.buildServer.serverSide.userChanges.CanceledInfo)

Aggregations

CanceledInfo (jetbrains.buildServer.serverSide.userChanges.CanceledInfo)1