Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active May 11, 2019 20:20
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/3061129821e17ea1d5fb9553df83e68d to your computer and use it in GitHub Desktop.
Save iaindooley/3061129821e17ea1d5fb9553df83e68d to your computer and use it in GitHub Desktop.
Copy Template Board
function copyTemplateBoard(notification)
{
var added = new Notification(notification).createdCard();
var template = new Trellinator().board("My Template");
var board = template.copy(added.name());
added.attachLink(board.link());
board.cards().each(function(card)
{
try
{
var att = card.cardsLinkedInAttachments().first();
card.attachLink(board.card(att.name()).link());
card.attachments().each(function(linked)
{
if(att.id() == new Card({link: linked.link()}).id())
linked.remove();
});
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment