Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions import.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ const importFile = (octokit, file, values) => {
sendObj.issue.title = row[titleIndex];

// if we have a body column, pass that.
if (bodyIndex > -1 && row[bodyIndex] !== "") {
sendObj.issue.body = row[bodyIndex];
if (bodyIndex > -1) {
if (row[bodyIndex] !== "") {
sendObj.issue.body = row[bodyIndex];
}
else {
// if the body is not defined, copy the title to the body of the issue
sendObj.issue.body = row[titleIndex];
}
}

// if we have a labels column, pass that.
Expand Down
3 changes: 3 additions & 0 deletions test/emptyBodyLines.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title, body,labels
Test 1, , bug
Test 2, This is the test2 desc, question