Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created November 10, 2019 08:43
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/5fc0437ac68aa39589cbe56cad65d5b1 to your computer and use it in GitHub Desktop.
Save iaindooley/5fc0437ac68aa39589cbe56cad65d5b1 to your computer and use it in GitHub Desktop.
Create custom report
function createCustomReport(params,signature,original_time)
{
var output = [];
new Board(params).list("Live on MP").cards().each(function(card)
{
output.push(reportLineForCard(card));
});
MailApp.send("iain@benkoboard.com","Report for: "+Trellinator.now().butlerDefaultDate(),output.join("\n\n"));
ExecutionQueue.push("createCustomReport",params,signature,original_time.addHours(24));
}
function reportLineForCard(card)
{
var ret = "- ["+card.name()+"]("+card.link()+")";
card.labels().each(function(label)
{
if(label.colour() == "yellow")
ret += " - ("+label.name()+")";
else if(label.colour() == "pink")
ret += " - ("+label.name()+")";
});
ret += "\n\n\n--- ";
card.checklists().each(function(cl)
{
var line1 = cl.items().findByName(/^(Offers Due Date|Funds Due Date): .*/).asArray().join(" | ").trim();
if(line1)
ret += "--- "+line1;
var line2 = cl.items().findByName(/^(CrowdStreet Equity Allocation Goal|Max Allocation \(target in portal\)): .*/).asArray().join(" | ").trim();
if(line2)
ret += "--- "+line2;
});
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment