diff --git a/packages/import-ynab4/importer.js b/packages/import-ynab4/importer.js
index c0633e67bbce8456ddf19360851e61ee58c8b306..d8b71b0ef1e9b15c433bdd0ddccae8710efacc16 100644
--- a/packages/import-ynab4/importer.js
+++ b/packages/import-ynab4/importer.js
@@ -222,6 +222,7 @@ async function importTransactions(data, entityIdMap) {
             transaction.subTransactions &&
             transaction.subTransactions.map((t, i) => {
               return {
+                id: entityIdMap.get(t.entityId),
                 amount: amountToInteger(t.amount),
                 category: getCategory(t.categoryId),
                 notes: t.memo || null,
diff --git a/packages/import-ynab5/importer.js b/packages/import-ynab5/importer.js
index 581f23fc68c02ac6e628771446ffb9af1595080b..d7f79aaddb4095746f750e9dec261ec3d5d65bc5 100644
--- a/packages/import-ynab5/importer.js
+++ b/packages/import-ynab5/importer.js
@@ -164,6 +164,9 @@ async function importTransactions(data, entityIdMap) {
   for (let transaction of data.transactions) {
     entityIdMap.set(transaction.id, uuidv4());
   }
+  for (let transaction of data.subtransactions) {
+    entityIdMap.set(transaction.id, uuidv4());
+  }
 
   await Promise.all(
     Object.keys(transactionsGrouped).map(async accountId => {
@@ -180,6 +183,7 @@ async function importTransactions(data, entityIdMap) {
           if (subtransactions) {
             subtransactions = subtransactions.map(subtrans => {
               return {
+                id: entityIdMap.get(subtrans.id),
                 amount: amountFromYnab(subtrans.amount),
                 category: entityIdMap.get(subtrans.category_id) || null,
                 notes: subtrans.memo,
diff --git a/upcoming-release-notes/1224.md b/upcoming-release-notes/1224.md
new file mode 100644
index 0000000000000000000000000000000000000000..9d8b758907af035e39f05daee80cc8d6fffc820a
--- /dev/null
+++ b/upcoming-release-notes/1224.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [j-f1]
+---
+
+Imports from YNAB4/nYNAB will now link transfer transactions correctly