grim/youtrack-import
Clone
Split the version field into AffectedVersion and FixVersion while having trac and bitbucket use AffectedVersion. Also put the trac milestone into the Fix Version.
--- a/bitbucket/converter.go Tue Aug 04 22:19:35 2020 -0500
+++ b/bitbucket/converter.go Tue Aug 11 22:10:48 2020 -0500
@@ -70,11 +70,11 @@
- Subsystem: bb.Component,
+ AffectedVersion: bb.Version, + Subsystem: bb.Component, --- a/trac/tickets.go Tue Aug 04 22:19:35 2020 -0500
+++ b/trac/tickets.go Tue Aug 11 22:10:48 2020 -0500
@@ -178,19 +178,20 @@
issue := &youtrack.Issue{
- Description: convertComment(t.Description),
- Created: convertTime(t.Time),
- Updated: convertTime(t.ChangeTime),
- Reporter: convertUsername(t.Reporter),
- Assignee: convertUsername(t.Owner),
- Version: convertString(t.Version),
- Subsystem: convertString(t.Component),
- Priority: priorityMap[convertString(t.Priority)],
- State: stateMap[t.Status],
+ Description: convertComment(t.Description), + Created: convertTime(t.Time), + Updated: convertTime(t.ChangeTime), + Reporter: convertUsername(t.Reporter), + Assignee: convertUsername(t.Owner), + AffectedVersion: convertString(t.Version), + FixVersion: convertString(t.Milestone), + Subsystem: convertString(t.Component), + Priority: priorityMap[convertString(t.Priority)], + State: stateMap[t.Status], // There are some instances were reporters are null in our trac database, so
--- a/trac/versions.go Tue Aug 04 22:19:35 2020 -0500
+++ b/trac/versions.go Tue Aug 11 22:10:48 2020 -0500
@@ -14,9 +14,23 @@
func (e *environment) loadVersions() ([]youtrack.Version, error) {
+ // we grab both the versions and the milestones as milestones are + // essentially treated as the fix version in trac. - "SELECT * from version ORDER BY name DESC",
+ a.name, a.time, a.description + b.name, b.due as time, b.description + trac_pidgin.milestone b + (SELECT NULL FROM trac_pidgin.version c WHERE c.name = b.name) ytVersions := make([]youtrack.Version, len(versions))
--- a/youtrack/issue.go Tue Aug 04 22:19:35 2020 -0500
+++ b/youtrack/issue.go Tue Aug 11 22:10:48 2020 -0500
@@ -9,21 +9,22 @@
@@ -109,8 +110,12 @@
x.AddField("permittedGroup", i.PermittedGroup)
- x.AddField("Fix Versions", i.Version)
+ if i.AffectedVersion != "" { + x.AddField("Affected Versions", i.AffectedVersion) + if i.FixVersion != "" { + x.AddField("Fix Versions", i.FixVersion)