.newEstimate(getNewEstimate()) .buildNewEstimate(); worklogResult = worklogService.validateCreateWithNewEstimate(getJiraServiceContext(), params);
public void doValidation() { final CommentVisibility commentVisibility = getCommentVisibility(); final Visibility visibility = Visibilities.fromGroupAndStrRoleId(commentVisibility.getGroupLevel(), commentVisibility.getRoleLevel()); // Call the correct validation on the service so that we can get the worklog to update final WorklogInputParametersImpl.Builder builder = WorklogInputParametersImpl .timeSpent(getTimeLogged()) .worklogId(getWorklogId()) .startDate(getParsedStartDate()) .comment(getComment()) .visibility(visibility); if (ADJUST_ESTIMATE_NEW.equalsIgnoreCase(adjustEstimate)) { final WorklogNewEstimateInputParameters params = builder .newEstimate(getNewEstimate()) .buildNewEstimate(); worklogResult = worklogService.validateUpdateWithNewEstimate(getJiraServiceContext(), params); } else { final WorklogInputParameters params = builder.build(); worklogResult = worklogService.validateUpdate(getJiraServiceContext(), params); } }
builder.newEstimate(newEstimate);
.groupLevel(groupLevel) .roleLevelId(roleLevelId) .newEstimate(newRemainingEstimate) .buildNewEstimate(); WorklogNewEstimateResult worklogResult = worklogService.validateCreateWithNewEstimate(serviceContext, params);
public void updateWorklogWithNewRemainingEstimate(User user, RemoteWorklog remoteWorklog, String newRemainingEstimate) throws RemoteException, RemotePermissionException, RemoteValidationException { JiraServiceContext serviceContext = new JiraServiceContextImpl(user, new SimpleErrorCollection()); Long id = SoapUtils.toLongRequired(remoteWorklog.getId()); String timeSpent = remoteWorklog.getTimeSpent(); Date startDate = remoteWorklog.getStartDate(); String comment = remoteWorklog.getComment(); String groupLevel = remoteWorklog.getGroupLevel(); String roleLevelId = remoteWorklog.getRoleLevelId(); final WorklogNewEstimateInputParameters params = WorklogInputParametersImpl .timeSpent(timeSpent) .worklogId(id) .startDate(startDate) .comment(comment) .groupLevel(groupLevel) .roleLevelId(roleLevelId) .newEstimate(newRemainingEstimate) .buildNewEstimate(); WorklogNewEstimateResult worklogResult = worklogService.validateUpdateWithNewEstimate(serviceContext, params); checkAndThrowValidationException(serviceContext.getErrorCollection()); if (worklogResult == null) { throw new RemoteValidationException(getI18nHelper().getText("error.unexpected.condition", "WorklogService.validateUpdateWithNewEstimate")); } worklogService.updateWithNewRemainingEstimate(serviceContext, worklogResult, true); checkAndThrowRemoteException(serviceContext.getErrorCollection()); }
private WorklogInputParametersImpl.Builder getWorklogInputParams(Issue issue, WorklogValue value) { boolean editableCheckRequired = value.isEditIssue(); final CommentVisibility commentVisibility = new CommentVisibility(value.commentLevel()); final Visibility visibility = Visibilities.fromGroupAndStrRoleId(commentVisibility.getGroupLevel(), commentVisibility.getRoleLevel()); final Date parsedStartDate = WorklogValue.Builder.parseStartDate(getOutlookDateManager(), authenticationContext.getLocale(), value.startDate()); return WorklogInputParametersImpl .issue(issue) .timeSpent(value.timeLogged()) .startDate(parsedStartDate) .worklogId(value.id()) .comment(value.comment()) .visibility(visibility) .editableCheckRequired(editableCheckRequired) .newEstimate(value.newEstimate()) .adjustmentAmount(value.adjustmentAmount()) .errorFieldPrefix(IssueFieldConstants.WORKLOG + "_"); }