Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active April 17, 2019 22:03
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/3d9e7110b3023fb7fbf3cab532c6aa6c to your computer and use it in GitHub Desktop.
Save iaindooley/3d9e7110b3023fb7fbf3cab532c6aa6c to your computer and use it in GitHub Desktop.
Detect new activity
function detectNewActivity(board,signature,original_time)
{
new Board(board).cards().each(function(card)
{
try
{
card.boardsLinkedInAttachments().first().cards().each(function(loop)
{
var one_day_ago = Trellinator.now().minusDays(1);
//if a card has had a comment within the last day or a list move within the last day
if((loop.comments().first().when() > one_day_ago) || (loop.movedToList() > one_day_ago))
card.addLabel("New Activity");
});
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
}
}
ExecutionQueue.push("detectNewActivity",board,signature,original_time.addDays(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment