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

Method ImportIssueWorklog

backend/plugins/customize/service/service.go:672–683  ·  view source on GitHub ↗

ImportIssueWorklog imports csv file into the table `issue_worklogs`

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

Source from the content-addressed store, hash-verified

670
671// ImportIssueWorklog imports csv file into the table `issue_worklogs`
672func (s *Service) ImportIssueWorklog(boardId string, file io.ReadCloser, incremental bool) errors.Error {
673 if !incremental {
674 err := s.dal.Delete(
675 &ticket.IssueWorklog{},
676 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),
677 )
678 if err != nil {
679 return err
680 }
681 }
682 return s.importCSV(file, boardId, s.issueWorklogHandler)
683}
684
685// issueWorklogHandler saves a record into the `issue_worklogs` table
686func (s *Service) issueWorklogHandler(record map[string]interface{}) errors.Error {

Callers 1

Calls 2

importCSVMethod · 0.95
DeleteMethod · 0.65

Tested by 1