Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created March 27, 2019 23:12
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/f6d89afac01d0961c9020ac704f245b2 to your computer and use it in GitHub Desktop.
Save iaindooley/f6d89afac01d0961c9020ac704f245b2 to your computer and use it in GitHub Desktop.
Sort cards by date modified descending
function sortCardsByDateModifiedDescending()
{
var sheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet("Cards Last Modified");
new IterableCollection(TrelloApi
.searchCardsInTeams(new Trellinator().team("My Team"),"edited:week")
.asArray()
.sort(function(card1,card2)
{
return card2.lastActivity().getTime() - card.lastActivity().getTime();
})).each(function(card)
{
sheet.appendRow([card.link(),card.lastActivity().toLocaleString(),card.name()]);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment