Created
August 4, 2020 05:34
-
-
Save iaindooley/2464ce050244fcb21565cd839d2e6201 to your computer and use it in GitHub Desktop.
Sum custom fields
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
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