public boolean setTechnicalDebt( DefaultIssue issue, @Nullable Duration value, IssueChangeContext context) { Duration oldValue = issue.debt(); if (!Objects.equal(value, oldValue)) { issue.setDebt(value != null ? value : null); issue.setFieldChange( context, TECHNICAL_DEBT, oldValue != null ? oldValue.toMinutes() : null, value != null ? value.toMinutes() : null); issue.setUpdateDate(context.date()); issue.setChanged(true); return true; } return false; }
public boolean setPastTechnicalDebt( DefaultIssue issue, @Nullable Duration previousTechnicalDebt, IssueChangeContext context) { Duration currentTechnicalDebt = issue.debt(); issue.setDebt(previousTechnicalDebt); return setTechnicalDebt(issue, currentTechnicalDebt, context); }