Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active November 8, 2019 23:53
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/26258599480e5c1ec1c2a64d88c036af to your computer and use it in GitHub Desktop.
Save iaindooley/26258599480e5c1ec1c2a64d88c036af to your computer and use it in GitHub Desktop.
Init project template
function initProjectTemplate(notification)
{
var added = new Notification(notification).addedCard("Create Project")
var copy = Board.findOrCreate("Project Template").copy(added.name());
copy.list("Parent Tasks").cards().each(function(card)
{
relinkSubtasks(card);
});
added.attachLink(copy.link());
}
function relinkSubtasks(card)
{
card.checklist("Blocked tasks").items().each(function(item)
{
var new_target = card.board().card(item.linkedCard().name());
item.setName(new_target.link());
new_target.attachLink(card.link());
relinkSubtasks(new_target);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment