Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created August 4, 2020 05:34
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/2464ce050244fcb21565cd839d2e6201 to your computer and use it in GitHub Desktop.
Save iaindooley/2464ce050244fcb21565cd839d2e6201 to your computer and use it in GitHub Desktop.
Sum custom fields
new Trellinator().board("TEST").lists().each(function(list)
{
var listcount = 0;
list.cards().each(function(card)
{
try
{
listcount += parseInt(card.customFieldValue("Num"));
}
catch(e)
{
}
});
if(parts = /(.+) \([0-9]+\)/.exec(list.name()))
{
list.setName(parts[1]+" ("+listcount+")");
}
else
{
list.setName(list.name()+" ("+listcount+")");
}
});
console.log("All Done");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment