Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copy Trello checklist to clipboard
copy($(".checklist-item:not(.checklist-item-checked)").map(function() {
var e = $(this),
item = e.find(".checklist-item-details-text").text()
if (e.hasClass("checklist-item-state-complete")) {
item = item + " (DONE)"
}
return item
}).get().join("\n"))
@davidtingsu

This comment has been minimized.

Copy link

@davidtingsu davidtingsu commented Mar 11, 2016

i would like to turn this into a chrome plugin. what is the license on this code? will give your gist some credit.

@waynesutton

This comment has been minimized.

Copy link

@waynesutton waynesutton commented May 19, 2016

Hi, how do I use the code above?

David, let me know if you created a chrome plugin. I need it :)

@ksoo

This comment has been minimized.

Copy link

@ksoo ksoo commented May 15, 2017

In Chrome, open the Trello Card with the checklist, and then select Chrome's More Tools => Developer Tools => Console, copy and paste this Javascript code in, and press Enter to run. The checklist text will then (silently) be on your system Clipboard, and you can paste it elsewhere.

@chiffrezlacasse

This comment has been minimized.

Copy link

@chiffrezlacasse chiffrezlacasse commented Oct 20, 2017

Thanks!!

@rnjailamba

This comment has been minimized.

Copy link

@rnjailamba rnjailamba commented Jan 3, 2019

@davidtingsu, did you make it?

@benctv

This comment has been minimized.

Copy link

@benctv benctv commented May 11, 2019

Thank you! Felt so good to have something simple and work! Wonderful.

@Max-Makhrov

This comment has been minimized.

Copy link

@Max-Makhrov Max-Makhrov commented Jun 24, 2020

In Chrome, open the Trello Card with the checklist, and then select Chrome's More Tools => Developer Tools => Console, copy and paste this Javascript code in, and press Enter to run. The checklist text will then (silently) be on your system Clipboard, and you can paste it elsewhere.

Thank you!

for some reason this code works for me:

$(".checklist-item").map(function(i, item) { 
	let text = $(item).find(".checklist-item-details-text").text(); 
	if( $(item).hasClass("checklist-item-state-complete") ) {
		text += " (DONE)";
    }
	return text;
}).get().join('\n')

The original one throws undefined...

UPDATE: missed this instruction =):

The checklist text will then (silently) be on your system Clipboard, and you can paste it elsewhere.

@ChaiBapchya

This comment has been minimized.

Copy link

@ChaiBapchya ChaiBapchya commented Nov 18, 2020

God bless you for creating this snippet!

@vsvld

This comment has been minimized.

Copy link

@vsvld vsvld commented Dec 21, 2020

thank you!

@wcarmon

This comment has been minimized.

Copy link

@wcarmon wcarmon commented Apr 30, 2021

Thanks!

@szilard-nemeth

This comment has been minimized.

Copy link

@szilard-nemeth szilard-nemeth commented May 4, 2021

Thanks for this script, very useful.
For me, it didn't fully work for checklists that contain google, youtube or any other link that Trello detects and converts to a text in an overly smart manner. I haven't found a way to turn off this feature and it's a huge pain because if I copy the checklist, the textual version of the original links will be copied and not the original links.
An updated version of the script with parsing such smart links:

copy($(".checklist-item:not(.checklist-item-checked)").map(function() {
  var e = $(this),
      item = e.find(".checklist-item-details-text").text()
  
  var smartlinks = e.find(".atlaskit-smart-link")
  if (smartlinks.length) {
  	//sanity check
  	if (smartlinks.length != 1) {
  		console.error("length of smartlinks should be 1, but it is: " + smartlinks.length)	
  	} else { 
  		item = item + "  " + smartlinks.attr("href")
  	}
  }
  
  if (e.hasClass("checklist-item-state-complete")) {
    item = item + " (DONE)"
  }
  
  return item
}).get().join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment