MCPcopy Index your code
hub / github.com/apache/devlake / ImportIssueChangelog

Method ImportIssueChangelog

backend/plugins/customize/service/service.go:610–621  ·  view source on GitHub ↗

ImportIssueChangelog imports csv file into the table `issue_changelogs`

(boardId string, file io.ReadCloser, incremental bool)

Source from the content-addressed store, hash-verified

608
609// ImportIssueChangelog imports csv file into the table `issue_changelogs`
610func (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
624func (s *Service) issueChangelogHandler(record map[string]interface{}) errors.Error {

Callers 1

Calls 2

importCSVMethod · 0.95
DeleteMethod · 0.65

Tested by 1