Created
June 19, 2020 12:24
-
-
Save iaindooley/60a75f64c9c1632a956e93e5c7dc555d to your computer and use it in GitHub Desktop.
Move when percentage complete
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 moveWhenPercentageComplete(notification) | |
{ | |
var notif = new Notification(notification); | |
var cl = notif.completedChecklist(); | |
var complength = notif.card().checklists().find(function(loop) | |
{ | |
if(loop.isComplete()) | |
{ | |
return loop; | |
} | |
else | |
{ | |
return false; | |
} | |
}).length(); | |
var total = notif.card().checklists().length(); | |
var percentage = (complength*100)/total; | |
if(percentage > 70) | |
{ | |
notif.card().moveToList(notif.board().list("Done"),"top"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment