@Override public boolean deleteAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent) { return delete(jiraServiceContext, worklogResult, null, dispatchEvent); }
@Override public boolean deleteWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateResult worklogNewEstimate, boolean dispatchEvent) { return delete(jiraServiceContext, worklogNewEstimate, worklogNewEstimate.getNewEstimate(), dispatchEvent); }
@Override public boolean deleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountResult worklogResult, boolean dispatchEvent) { ErrorCollection errorCollection = jiraServiceContext.getErrorCollection(); if (worklogResult == null || worklogResult.getWorklog() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.worklog.null")); return false; } if (worklogResult.getWorklog().getIssue() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.issue.null")); return false; } // Calculate the new remaining estimate Long newEstimate = increaseEstimate(worklogResult.getWorklog().getIssue(), worklogResult.getAdjustmentAmount()); return delete(jiraServiceContext, worklogResult, newEstimate, dispatchEvent); }
@Override public boolean deleteAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent) { ErrorCollection errorCollection = jiraServiceContext.getErrorCollection(); //these null checks are duplicated in update() but must be run before passing worklog to getAutoAdjustNewEstimateOnUpdate() if (worklogResult == null || worklogResult.getWorklog() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.worklog.null")); return false; } if (worklogResult.getWorklog().getIssue() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.issue.null")); return false; } if (worklogResult.getWorklog().getId() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.worklog.id.null")); return false; } Long timeSpent = worklogResult.getWorklog().getTimeSpent(); Long newEstimate = increaseEstimate(worklogResult.getWorklog().getIssue(), timeSpent); return delete(jiraServiceContext, worklogResult, newEstimate, dispatchEvent); }