Last active
April 17, 2019 22:03
-
-
Save iaindooley/3d9e7110b3023fb7fbf3cab532c6aa6c to your computer and use it in GitHub Desktop.
Detect new activity
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 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