@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;
}
final Worklog worklog = worklogResult.getWorklog();
Long newEstimate = reduceEstimate(worklog.getIssue(), worklogResult.getAdjustmentAmount());
return create(jiraServiceContext, worklogResult, newEstimate, dispatchEvent);
}