Last active
November 8, 2019 23:53
-
-
Save iaindooley/26258599480e5c1ec1c2a64d88c036af to your computer and use it in GitHub Desktop.
Init project template
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 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