public static IssueChangeDto of(String issueKey, FieldDiffs diffs) { IssueChangeDto dto = newDto(issueKey); dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE); dto.setChangeData(diffs.toString()); dto.setUserLogin(diffs.userLogin()); return dto; }
public static IssueChangeDto of(DefaultIssueComment comment) { IssueChangeDto dto = newDto(comment.issueKey()); dto.setKey(comment.key()); dto.setChangeType(IssueChangeDto.TYPE_COMMENT); dto.setChangeData(comment.markdownText()); dto.setUserLogin(comment.userLogin()); return dto; }
private static IssueChangeDto newDto(String issueKey) { IssueChangeDto dto = new IssueChangeDto(); dto.setIssueKey(issueKey); // technical dates - do not use the context date Date now = new Date(); dto.setCreatedAt(now); dto.setUpdatedAt(new Date()); return dto; }