Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created January 15, 2019 01:09
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/94d09fc83c459fab3c8dc894de258758 to your computer and use it in GitHub Desktop.
Save iaindooley/94d09fc83c459fab3c8dc894de258758 to your computer and use it in GitHub Desktop.
Copy board
function newBoardFromTemplate(notification)
{
//When a card is added to the Project Kickoff list
var trigger_card = new Notification().addedCard(/Project Kickoff/);
//Find the template board
var template_board = Board.findOrCreate("Project Template");
//Copy this to a new board named after the created card in the "Work" team
var new_board = template_board.copy(trigger_card.name(),new Trellinator().team("Work"));
//Attach a link to the created board back to the trigger card
trigger_card.attachLink(new_board.link());
//Assign people to cards in the created board based on the template
new_board.cards().each(function(card)
{
template_board.card(card.name()).members().each(function(member)
{
card.addMember(member);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment