aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/jira/import.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/jira/import.go')
-rw-r--r--bridge/jira/import.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/bridge/jira/import.go b/bridge/jira/import.go
index 3d6d5414..b66b0fa3 100644
--- a/bridge/jira/import.go
+++ b/bridge/jira/import.go
@@ -216,7 +216,16 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
return nil, err
}
- b, err := repo.ResolveBugCreateMetadata(metaKeyJiraId, issue.ID)
+ b, err := repo.ResolveBugMatcher(func(excerpt *cache.BugExcerpt) bool {
+ if _, ok := excerpt.CreateMetadata[metaKeyJiraBaseUrl]; ok &&
+ excerpt.CreateMetadata[metaKeyJiraBaseUrl] != ji.conf[confKeyBaseUrl] {
+ return false
+ }
+
+ return excerpt.CreateMetadata[core.MetaKeyOrigin] == target &&
+ excerpt.CreateMetadata[metaKeyJiraId] == issue.ID &&
+ excerpt.CreateMetadata[metaKeyJiraProject] == ji.conf[confKeyProject]
+ })
if err != nil && err != bug.ErrBugNotExist {
return nil, err
}
@@ -241,6 +250,7 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
metaKeyJiraId: issue.ID,
metaKeyJiraKey: issue.Key,
metaKeyJiraProject: ji.conf[confKeyProject],
+ metaKeyJiraBaseUrl: ji.conf[confKeyBaseUrl],
})
if err != nil {
return nil, err