Skip to content

Instantly share code, notes, and snippets.

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/b7da564515d7fb8ce9431e789fcd76d7 to your computer and use it in GitHub Desktop.
Save iaindooley/b7da564515d7fb8ce9431e789fcd76d7 to your computer and use it in GitHub Desktop.
Copy Template and Set Due Dates
function copyTemplateAndSetDueDates(notification)
{
var created = new Notification(notification).createdCard();
var template = new Trellinator().board("My Template");
var copied = template.copy(created.name();
created.attachLink(copied.link());
var days_offset = (Trellinator.now().getTime() - template.card("First Task").due().getTime())/1000/60/60/24;
copied.cards().each(function(card)
{
card.setDue(card.due().addDays(days_offset));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment