public void checkinSuccessful() { if (markFixed == null) { // no associated work item return; } if (markFixed.isSelected() || (addComment.isSelected() && !comment.getText().isEmpty())) { EntityService entityService = project.getComponent(EntityService.class); LockingStrategy lockingStrategy = restService.getModelCustomization().getLockingStrategy(); Entity entity = lockingStrategy.lock(ref.toEntity()); if (entity != null) { Set<String> modified = new HashSet<String>(); if (markFixed.isSelected()) { String value = markFixedSelection.getSelectedItem().toString(); if (!value.equals(entity.getProperty("status"))) { entity.setProperty("status", value); modified.add("status"); } } if (addComment.isSelected() && !comment.getText().isEmpty()) { String userName = project.getComponent(AliProjectConfiguration.class).getUsername(); String fullName = project.getComponent(ProjectUserService.class).getUser(userName).getFullName(); String commentProperty = entity.isInitialized("dev-comments") ? "dev-comments" : "comments"; String mergedComment = CommentField.mergeComment( entity.getPropertyValue(commentProperty), comment.getText(), userName, fullName); entity.setProperty(commentProperty, mergedComment); modified.add(commentProperty); } entityService.updateEntity(entity, modified, false); lockingStrategy.unlock(entity); } } }