Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active May 6, 2020 04:30
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/7650431ac540b0bb04fa05fd186fee90 to your computer and use it in GitHub Desktop.
Save iaindooley/7650431ac540b0bb04fa05fd186fee90 to your computer and use it in GitHub Desktop.
Backfill due dates on linked checklist cards
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