ImportIssueChangelog imports csv file into the table `issue_changelogs`
(boardId string, file io.ReadCloser, incremental bool)
| 608 | |
| 609 | // ImportIssueChangelog imports csv file into the table `issue_changelogs` |
| 610 | func (s *Service) ImportIssueChangelog(boardId string, file io.ReadCloser, incremental bool) errors.Error { |
| 611 | if !incremental { |
| 612 | err := s.dal.Delete( |
| 613 | &ticket.IssueChangelogs{}, |
| 614 | dal.Where("issue_id IN (SELECT issue_id FROM board_issues WHERE board_id=? AND issue_id NOT IN (SELECT issue_id FROM board_issues WHERE board_id!=?))", boardId, boardId), |
| 615 | ) |
| 616 | if err != nil { |
| 617 | return err |
| 618 | } |
| 619 | } |
| 620 | return s.importCSV(file, boardId, s.issueChangelogHandler) |
| 621 | } |
| 622 | |
| 623 | // issueChangelogHandler saves a record into the `issue_changelogs` table |
| 624 | func (s *Service) issueChangelogHandler(record map[string]interface{}) errors.Error { |