Open dev0zzz opened 4 years ago
Thanks for the report. Looks like a bug - right now the code handles the single-object items (user
, assignee
, milestone
, closed_by
), but we'll have to update it to handle the arrays (labels
, assignees
). PRs welcome!
It seems that the logics are already implemented in defaultExportColumns
method, but not in specificAttributeColumns
https://github.com/gavinr/github-csv-tools/blob/475a58f74269a3a51f7c86dc43f6e778b0e5b665/export.js#L108-L130
As a temporary workaround, a simple change to specificAttributeColumns
can resolve the labels
issue. (Adding the if-clause)
const specificAttributeColumns = (data, attributes) => {
return data.map((issueObject) => {
const ret = {};
attributes.forEach((attribute) => {
ret[attribute] = getDataAttribute(issueObject, attribute);
if (attribute === "labels") {
ret[attribute] = issueObject.labels
.map((labelObject) => {
return labelObject.name;
})
.join(",");
}
});
return ret;
});
};
But this could be a bit redundant. Maybe we can decompose export.js#L108-L130 to a single method that is invoked by both defaultExportColumns
and specificAttributeColumns
?
is this still being worked on? I get blanks when trying to export labels.name
When I write the command
I get all the label attributes, I just want to have the labels.name
but if I type labels.name i get nothing