Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save the epic type issues as well as the normal issues #4786

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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