/** * Checks if the given String is a valid amount of time to change an estimate by. * * @param jiraServiceContext JiraServiceContext * @param adjustmentAmount String with amount of time eg "3d 4h" * @return true if this change is a valid time. */ protected boolean isValidAdjustmentAmount(JiraServiceContext jiraServiceContext, String adjustmentAmount) { return isValidAdjustmentAmount(jiraServiceContext, adjustmentAmount, null); }
@Override public WorklogAdjustmentAmountResult validateDeleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String adjustmentAmount) { WorklogResult originalWorklogResult = validateDelete(jiraServiceContext, worklogId); if (originalWorklogResult != null && isValidAdjustmentAmount(jiraServiceContext, adjustmentAmount)) { return WorklogResultFactory.createAdjustmentAmount(originalWorklogResult, getDurationForFormattedString(adjustmentAmount, jiraServiceContext)); } return null; }
@Override public WorklogAdjustmentAmountResult validateCreateWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountInputParameters params) { WorklogResult worklogResult = validateCreate(jiraServiceContext, params); if (isValidAdjustmentAmount(jiraServiceContext, params.getAdjustmentAmount(), params.getErrorFieldPrefix()) && worklogResult != null) { return WorklogResultFactory.createAdjustmentAmount(worklogResult, getDurationForFormattedString(params.getAdjustmentAmount(), jiraServiceContext)); } return null; }