Skip to content

Commit

Permalink
fix: save the epic type issues as well as the normal issues (#4786)
Browse files Browse the repository at this point in the history
  • Loading branch information
mindlesscloud authored Mar 28, 2023
1 parent 52ee8ed commit 29f0c5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/plugins/jira/tasks/epic_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func ExtractEpics(taskCtx plugin.SubTaskContext) errors.Error {
Table: RAW_EPIC_TABLE,
},
Extract: func(row *api.RawData) ([]interface{}, errors.Error) {
return extractIssues(data, mappings, true, row)
return extractIssues(data, mappings, row)
},
})
if err != nil {
Expand Down
16 changes: 7 additions & 9 deletions backend/plugins/jira/tasks/issue_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func ExtractIssues(taskCtx plugin.SubTaskContext) errors.Error {
Table: RAW_ISSUE_TABLE,
},
Extract: func(row *api.RawData) ([]interface{}, errors.Error) {
return extractIssues(data, mappings, false, row)
return extractIssues(data, mappings, row)
},
})
if err != nil {
Expand All @@ -84,7 +84,7 @@ func ExtractIssues(taskCtx plugin.SubTaskContext) errors.Error {
return extractor.Execute()
}

func extractIssues(data *JiraTaskData, mappings *typeMappings, ignoreBoard bool, row *api.RawData) ([]interface{}, errors.Error) {
func extractIssues(data *JiraTaskData, mappings *typeMappings, row *api.RawData) ([]interface{}, errors.Error) {
var apiIssue apiv2models.Issue
err := errors.Convert(json.Unmarshal(row.Data, &apiIssue))
if err != nil {
Expand Down Expand Up @@ -156,13 +156,11 @@ func extractIssues(data *JiraTaskData, mappings *typeMappings, ignoreBoard bool,
results = append(results, user)
}
}
if !ignoreBoard {
results = append(results, &models.JiraBoardIssue{
ConnectionId: data.Options.ConnectionId,
BoardId: data.Options.BoardId,
IssueId: issue.IssueId,
})
}
results = append(results, &models.JiraBoardIssue{
ConnectionId: data.Options.ConnectionId,
BoardId: data.Options.BoardId,
IssueId: issue.IssueId,
})
labels := apiIssue.Fields.Labels
for _, v := range labels {
issueLabel := &models.JiraIssueLabel{
Expand Down

0 comments on commit 29f0c5f

Please sign in to comment.