Created
February 21, 2019 06:50
-
-
Save iaindooley/54eed49157d54ca8452d59f678f7a384 to your computer and use it in GitHub Desktop.
Delete cards older than 1 year
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
//schedule this function to run tomorrow at 3am using a time trigger | |
//in your Trellinator configuration sheet. It will then | |
//execute daily | |
function deleteOlderThanOneYear(board,signature,original_time) | |
{ | |
new Board(board).list("Completed").cards().each(function(card) | |
{ | |
if(card.movedToList() < Trellinator.now().minusDays(365)) | |
{ | |
card.archive(); | |
} | |
}); | |
ExecutionQueue.push("deleteOlderThanOneYear",board,signature,original_time.addDays(1)); | |
} | |
//schedule this function to at midnight this Sunday using | |
//a time trigger in your Trellinator configuration sheet. It will | |
//then execute weekly | |
function deleteArchivedCards(board) | |
{ | |
TrelloApi.searchCardsInBoards(new Board(board),"is:archived").each(function(card) | |
{ | |
card.del() | |
}); | |
ExecutionQueue.push("deleteArchivedCards",board,signature,original_time.addDays(7)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment