@Override public Worklog validateAndPerformAndSetNewEstimate(JiraServiceContext serviceContext, Issue issue, WorklogInputParameters worklogInputParameters) { WorklogNewEstimateResult worklogResult = getWorklogService().validateDeleteWithNewEstimate(serviceContext, worklogInputParameters.getWorklogId(), ((WorklogNewEstimateInputParameters) worklogInputParameters).getNewEstimate()); boolean success = getWorklogService().deleteWithNewRemainingEstimate(serviceContext, worklogResult, true); return success ? worklogResult.getWorklog() : null; }
public void doValidation() { // Call the correct validation on the service so that we can get the worklog to update if (ADJUST_ESTIMATE_NEW.equalsIgnoreCase(adjustEstimate)) { worklogResult = worklogService.validateDeleteWithNewEstimate(getJiraServiceContext(), getWorklogId(), getNewEstimate()); } else if (ADJUST_ESTIMATE_MANUAL.equalsIgnoreCase(adjustEstimate)) { worklogResult = worklogService.validateDeleteWithManuallyAdjustedEstimate(getJiraServiceContext(), getWorklogId(), getAdjustmentAmount()); } else { worklogResult = worklogService.validateDelete(getJiraServiceContext(), getWorklogId()); } }
public void deleteWorklogWithNewRemainingEstimate(User user, String remoteWorklogId, String newRemainingEstimate) throws RemoteException, RemotePermissionException, RemoteValidationException { JiraServiceContext serviceContext = new JiraServiceContextImpl(user, new SimpleErrorCollection()); Long id = SoapUtils.toLongRequired(remoteWorklogId); WorklogNewEstimateResult worklogResult = worklogService.validateDeleteWithNewEstimate(serviceContext, id, newRemainingEstimate); checkAndThrowValidationException(serviceContext.getErrorCollection()); if (worklogResult == null) { throw new RemoteValidationException(getI18nHelper().getText("error.unexpected.condition", "WorklogService.validateDeleteWithNewEstimate")); } worklogService.deleteWithNewRemainingEstimate(serviceContext, worklogResult, true); checkAndThrowRemoteException(serviceContext.getErrorCollection()); }