--- a/bitbucket/converter.go Wed Jan 15 04:55:15 2020 -0600
+++ b/bitbucket/converter.go Wed Jan 15 06:11:24 2020 -0600
@@ -48,7 +48,7 @@
- Description: bb.Content,
+ Description: replaceKeywords(userMap, bb.Content), @@ -134,7 +134,7 @@
ytComment = &youtrack.Comment{
+ Text: replaceKeywords(userMap, comment.Content), Created: comment.CreatedOn,
Updated: comment.UpdatedOn,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bitbucket/keywords.go Wed Jan 15 06:11:24 2020 -0600
@@ -0,0 +1,36 @@
+ "hg.sr.ht/~grim/youtrack-import/youtrack" + mentionRegex = regexp.MustCompile(`@\{(.+?)\}`) +func replaceMentions(m map[string]*youtrack.User, message string) string { + matches := mentionRegex.FindAllStringSubmatch(message, -1) + for _, match := range matches { + if user, found := m[id]; found { + output = strings.Replace(output, old, "@"+user.Login, 1) +func replaceKeywords(m map[string]*youtrack.User, message string) string { + output = replaceMentions(m, output)