Thanks @Gisela_Nogueira!
It looks like the Community formatter changed a couple of JavaScript fields to URL links. I update the post and fixed the code in the import definition.
And here is the JavaScript part separately that transforms retrieved data in needed format for data mapping:
// retrieves all sprints within one board and will go from the last sprint and rank decreasingly closed sprints
var sprints = [{
sprint_id: null,
spint_week: null
}];
var allSprints = [];
var allSprintsLoaded = false;
startAt = 0;
maxResult = 50;
if (doc.type == "scrum") {
do
{
result = getDocument( "/rest/agile/1.0/board/" + doc.id + "/sprint?startAt=" + startAt + "&maxResults=" + maxResult, {ignoreErrors: "404"});
if (result && result.values ) {
allSprints = allSprints.concat(result.values);
allSprintsLoaded = result.isLast;
startAt = startAt + maxResult;
}
}
while (!allSprintsLoaded);
if (allSprints ) {
for(var i = 0; i < allSprints.length; i++) {
var sprint = allSprints[i];
if (sprint && sprint.originBoardId == doc.id ) {
if (sprint.startDate) {
date = new Date(Date.parse(sprint.startDate));
date.setUTCDate(date.getUTCDate() + 1 - (date.getUTCDay()||7));
sprints.push({
sprint_id: sprint.id,
spint_week: strftime("%yW%U, %b %d %Y", date)
});
}
}
}
}
}
return _.uniq(sprints);