Created
June 22, 2020 00:10
-
-
Save iaindooley/3c114ddc6ca709ecbb403cdcec4df390 to your computer and use it in GitHub Desktop.
Report by aggregated checklist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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