Last active
May 6, 2020 04:30
-
-
Save iaindooley/7650431ac540b0bb04fa05fd186fee90 to your computer and use it in GitHub Desktop.
Backfill due dates on linked checklist cards
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 backfillDueDatesOnLinkedChecklistCards(notification) | |
{ | |
var added = new Notification(notification).addedDueDate(); | |
added.board().card("Checklist Templates") | |
.copyUniqueChecklist("Production",added); | |
added.checklist("Production").items().each(function(item) | |
{ | |
if(parts = /([0-9]+) days? (.+)/.exec(item.name())) | |
{ | |
item.setName( | |
Card.create(added.board().list("To-Do"),parts[2]).setDue(new Date(added.due()).minusDays(parts[1]) | |
.attachLink(added.link()) | |
.link() | |
) | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment