@Override public Worklog createAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent) { return create(jiraServiceContext, worklogResult, null, dispatchEvent); }
@Override public Worklog createWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateResult worklogResult, boolean dispatchEvent) { return create(jiraServiceContext, worklogResult, worklogResult.getNewEstimate(), dispatchEvent); }
@Override public Worklog createWithManuallyAdjustedEstimate(final JiraServiceContext jiraServiceContext, final WorklogAdjustmentAmountResult worklogResult, final boolean dispatchEvent) { ErrorCollection errorCollection = jiraServiceContext.getErrorCollection(); if (worklogResult == null || worklogResult.getWorklog() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.worklog.null")); return null; } if (worklogResult.getWorklog().getIssue() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.issue.null")); return null; } // Calculate the new remaining estimate final Worklog worklog = worklogResult.getWorklog(); Long newEstimate = reduceEstimate(worklog.getIssue(), worklogResult.getAdjustmentAmount()); return create(jiraServiceContext, worklogResult, newEstimate, dispatchEvent); }
@Override public Worklog createAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent) { ErrorCollection errorCollection = jiraServiceContext.getErrorCollection(); if (worklogResult == null || worklogResult.getWorklog() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.worklog.null")); return null; } if (worklogResult.getWorklog().getIssue() == null) { errorCollection.addErrorMessage(getText(jiraServiceContext, "worklog.service.error.issue.null")); return null; } Long newEstimate = reduceEstimate(worklogResult.getWorklog().getIssue(), worklogResult.getWorklog().getTimeSpent()); return create(jiraServiceContext, worklogResult, newEstimate, dispatchEvent); }