Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JavaScript Bookmarklet to add-up all the estimated checklist items on a card in Trello.
var $lists=$(".checklist");
$.each($lists, function( key, value ) {
var $lName = $(value).find(".checklist-title h3");
var $lNameInput = $(value).find(".checklist-title input");
var $items = $(value).find(".checklist-item");
var $tot = 0;
$.each($items, function(key, value) {
var $itemText = $(value).find(".checklist-item-details-text");
var $itemEst = $itemText[0].innerText.match(/\(\d+\.?\d*\)/g);
if ($itemEst) {
$itemEst = new Number($itemEst[0].replace("(", '').replace(")", ''));
if (!isNaN($itemEst)) {
$tot += $itemEst;
$lNameUp = $lName[0].innerText.match(/^[^\(]*/i);
$lNameUp += ' (' + $tot + ')';
$lName[0].innerText = $lNameUp;
Copy link

3mkay commented Nov 26, 2013

Instructions for use:

  1. Create a bookmarklet which contains the above code... or drag the link from this page to your bookmark toolbar.
  2. Go to a trello card
  3. Create a checklist
  4. Add some items with estimates added in brackets e.g. (0.5)
  5. Click on the bookmarklet and see the checklist titles update with a total of your estimates

Note: If estimates aren't fixed, just add a ? or some non-numeric character into the estimate and they'll be excluded from the sum

Copy link

3mkay commented Jan 21, 2014

Gist updated for recent Trello changes

Copy link

ThePlenkov commented Sep 25, 2015

well done! Could you please advise how to aggregate now checklists to card name?

Then Scrum for Trello plugin will be compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment