Skip to content

Instantly share code, notes, and snippets.

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/797be1d69e79ff28ad40b9cab940d956 to your computer and use it in GitHub Desktop.
Save iaindooley/797be1d69e79ff28ad40b9cab940d956 to your computer and use it in GitHub Desktop.
Post comments for EN COURS actions
/*
"when a card is moved from the" EN COURS "list,
for each member of the card, post a comment"
more! @ {matchedinitials} {cardhoursinpreviouslist}
enter the time in {triggerhourspreviouslistname} "
*/
function postMoreCommentWhenMoved(notification)
{
var notif = new Notification(notification);
var moved = notif.movedCard();
//NB: the movedToPreviousList() function doesn't exist yet, but implementation
//would be similar to movedToList():
//https://www.theprocedurepeople.com/trellinator-automate-trello/docs/trellinator-libs_Card.js.html#line227
var hoursdiff = (Trellinator.now() - moved.movedToPreviousList())/1000/60/60;
if(notif.listBefore().name() == "EN COURS")
{
moved.members().each(function(member)
{
moved.postComment("more! @ "+member.name()+" "+hoursdiff);
});
}
}
//"every day at 7.14pm, for each card on the" EN COURS "list, post a" more! "comment. @BLE {cardhoursinlist} "
function postDailyComment(params,signature,original_time)
{
new Board(params).list("EN COURS").cards().each(function(card)
{
var hoursdiff = (Trellinator.now() - card.movedToList())/1000/60/60;
card.postComment("more! @BLE "+hoursdiff);
});
ExecutionQueue.push("postDailyComment",params,signature,original_time.addDays(1).at("19:14"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment