@Override public Worklog validateAndPerformAndManualAdjustEstimate(JiraServiceContext serviceContext, Issue issue, WorklogInputParameters worklogInputParameters) { WorklogAdjustmentAmountResult worklogResult = getWorklogService().validateDeleteWithManuallyAdjustedEstimate(serviceContext, worklogInputParameters.getWorklogId(), ((WorklogAdjustmentAmountInputParameters) worklogInputParameters).getAdjustmentAmount()); boolean success = getWorklogService().deleteWithManuallyAdjustedEstimate(serviceContext, worklogResult, true); return success ? worklogResult.getWorklog() : null; }
@RequiresXsrfCheck protected String doExecute() throws Exception { // Based on how the user wants to update the remaining estimate we will call the correct do method on the service if (ADJUST_ESTIMATE_AUTO.equalsIgnoreCase(adjustEstimate)) { worklogService.deleteAndAutoAdjustRemainingEstimate(getJiraServiceContext(), worklogResult, true); } else if (ADJUST_ESTIMATE_NEW.equalsIgnoreCase(adjustEstimate)) { worklogService.deleteWithNewRemainingEstimate(getJiraServiceContext(), (WorklogNewEstimateResult) worklogResult, true); } else if (ADJUST_ESTIMATE_MANUAL.equalsIgnoreCase(adjustEstimate)) { worklogService.deleteWithManuallyAdjustedEstimate(getJiraServiceContext(), (WorklogAdjustmentAmountResult) worklogResult, true); } else { worklogService.deleteAndRetainRemainingEstimate(getJiraServiceContext(), worklogResult, true); } if (getHasErrorMessages()) { return ERROR; } if (isInlineDialogMode()) { return returnComplete(); } return getRedirect("/browse/" + getIssue().getString("key")); }