Last active
April 24, 2020 02:22
-
-
Save iaindooley/a2ae55eb191fc8c58126895e5226d765 to your computer and use it in GitHub Desktop.
Move old cards to archive
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
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