@Override
public boolean deleteAndAutoAdjustRemainingEstimate(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 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);
}