Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active April 24, 2020 02:22
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/a2ae55eb191fc8c58126895e5226d765 to your computer and use it in GitHub Desktop.
Save iaindooley/a2ae55eb191fc8c58126895e5226d765 to your computer and use it in GitHub Desktop.
Move old cards to archive
function moveOldCardsToArchive()
{
var lists = {};
var timelimit = new Trellinator().now().minusMonths(3);
new Trellinator().board("My Board").list("Done").cards().each(function(card)
{
if(parts = /([0-9]{4}).*/.exec(card.title()) && (card.movedToList() < timelimit))
{
if(!lists[parts[1]])
{
lists[parts[1]] = Board.findOrCreate(parts[1]+" Archive").findOrCreateList("Inbox");
}
card.moveToList(lists[parts[1]],"top");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment