--- a/trac/tickets.go Mon Jul 27 21:57:08 2020 -0500
+++ b/trac/tickets.go Mon Jul 27 22:58:56 2020 -0500
@@ -7,6 +7,7 @@
"keep.imfreedom.org/grim/youtrack-import/youtrack"
@@ -142,7 +143,7 @@
Author: convertUsername(change.Author),
Created: convertTime(change.Time),
Updated: convertTime(change.Time),
// There's some oddness in our trac where we have a few changes where
@@ -202,8 +203,31 @@
issue.Attachments = make([]*youtrack.Attachment, len(t.Attachments))
for idx, attachment := range t.Attachments {
issue.Attachments[idx] = attachment.toYouTrack(t, users, unknownUser)
+ // create a comment for each attachment + description := fmt.Sprintf( + "Attachment: [%s](%s) added.\n\n%s", + convertString(attachment.Description), + newComment := &youtrack.Comment{ + Author: mapUser(attachment.Author, unknownUser, users), + Created: convertTime(attachment.Time), + Updated: convertTime(attachment.Time), + issue.Comments = append(issue.Comments, newComment) + // sort comments by time so that all of the attachment comments appear in + sort.Slice(issue.Comments, func(i, j int) bool { + return issue.Comments[i].Created.Before(issue.Comments[j].Created)