Created
April 8, 2020 01:01
-
-
Save iaindooley/797be1d69e79ff28ad40b9cab940d956 to your computer and use it in GitHub Desktop.
Post comments for EN COURS actions
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
/* | |
"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