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/dafe7be113b0283817ed744bab9bf532 to your computer and use it in GitHub Desktop.
Save iaindooley/dafe7be113b0283817ed744bab9bf532 to your computer and use it in GitHub Desktop.
Count labels of one kind
function countLabelsOfOneKind()
{
var output = [];
new Trellinator().board("My Board").lists().each(function(list)
{
output.push(list.name()+":\n");
var current = {};
list.cards().each(function(card)
{
card.labels().each(function(label)
{
if(!current[label.name()])
{
current[label.name()] = 0;
}
current[label.name()]++;
});
output.push(
new IterableCollection(current).find(function(number,name)
{
return name+": "+number;
}).asArray().join("\n");
);
});
});
Logger.log(output.join("\n"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment