Created
August 22, 2020 01:26
-
-
Save iaindooley/884bd51ca75f3278b41d39c7ca1bf40b to your computer and use it in GitHub Desktop.
Completed percentage
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 completedPercentage(notification) | |
{ | |
var completed = new Notification(notification).completedChecklistItem(); | |
var num_complete = completed.checklist().items().find(function(item) | |
{ | |
if(item.isComplete()) | |
return item; | |
else | |
return false; | |
}).length(); | |
var num_items = completed.checklist().items().length(); | |
completed.checklist().card().setCustomFieldValue("Percentage Complete",new Number((num_complete*100)/num_items).toFixed(2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment