Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/3c114ddc6ca709ecbb403cdcec4df390 to your computer and use it in GitHub Desktop.
Save iaindooley/3c114ddc6ca709ecbb403cdcec4df390 to your computer and use it in GitHub Desktop.
Report by aggregated checklist
function reportByAggregatedChecklist(params,signature,original_time)
{
var checklists_by_name = {};
var output = [];
new Board(params).list("My List").cards().each(function(card)
{
card.checklists().each(function(cl)
{
if(!checklists_by_name[cl.name()])
{
checklists_by_name[cl.name()] = [];
}
var cur_cl_out = [];
cl.items().each(function(item)
{
cur_cl_out.push(item.name()+": "+item.isComplete());
});
checklists_by_name[cl.name()].push(card.name()+"\n\n"+cur_cl_out.join("\n - "));
});
});
new IterableCollection(checklists_by_name).each(function(group,name)
{
output.push(name+"\n\n"+group.join("\n")+"\n");
}
MailApp.send("you@domain.com","Your report",output);
ExecutionQueue.push("reportByAggregatedChecklist",params,signature,original_time.addDays(1).at("7:00"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment