From 938e22c876f3002560b9002d645fd4d7cadf9a2b Mon Sep 17 00:00:00 2001 From: Lynwee <1507509064@qq.com> Date: Mon, 5 Aug 2024 22:47:28 +0800 Subject: [PATCH] fix unexpected incremental mode when re-transformating data (#7834) * fix(gitlab): use weburl as issue's url * fix(jira): fix unexpected incremental mode when re-transformating data * fix(lint): fix lint errors * fix(jira): simplify codes --- backend/plugins/jira/tasks/issue_extractor.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/plugins/jira/tasks/issue_extractor.go b/backend/plugins/jira/tasks/issue_extractor.go index 3d097d6914e..760b8c7cb4e 100644 --- a/backend/plugins/jira/tasks/issue_extractor.go +++ b/backend/plugins/jira/tasks/issue_extractor.go @@ -42,9 +42,9 @@ var ExtractIssuesMeta = plugin.SubTaskMeta{ } type typeMappings struct { - typeIdMappings map[string]string - stdTypeMappings map[string]string - standardStatusMappings map[string]models.StatusMappings + TypeIdMappings map[string]string + StdTypeMappings map[string]string + StandardStatusMappings map[string]models.StatusMappings } func ExtractIssues(subtaskCtx plugin.SubTaskContext) errors.Error { @@ -129,13 +129,13 @@ func extractIssues(data *JiraTaskData, mappings *typeMappings, row *api.RawData, } // code in next line will set issue.Type to issueType.Name - issue.Type = mappings.typeIdMappings[issue.Type] - issue.StdType = mappings.stdTypeMappings[issue.Type] + issue.Type = mappings.TypeIdMappings[issue.Type] + issue.StdType = mappings.StdTypeMappings[issue.Type] if issue.StdType == "" { issue.StdType = strings.ToUpper(issue.Type) } issue.StdStatus = getStdStatus(issue.StatusKey) - if value, ok := mappings.standardStatusMappings[issue.Type][issue.StatusKey]; ok { + if value, ok := mappings.StandardStatusMappings[issue.Type][issue.StatusKey]; ok { issue.StdStatus = value.StandardStatus } // issue commments @@ -239,8 +239,8 @@ func getTypeMappings(data *JiraTaskData, db dal.Dal) (*typeMappings, errors.Erro } } return &typeMappings{ - typeIdMappings: typeIdMapping, - stdTypeMappings: stdTypeMappings, - standardStatusMappings: standardStatusMappings, + TypeIdMappings: typeIdMapping, + StdTypeMappings: stdTypeMappings, + StandardStatusMappings: standardStatusMappings, }, nil }