Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active September 7, 2019 04:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iaindooley/81636c9a046375dca864a3dde3df5a06 to your computer and use it in GitHub Desktop.
Save iaindooley/81636c9a046375dca864a3dde3df5a06 to your computer and use it in GitHub Desktop.
Linked checklists
function linkCards(notification)
{
//Get a card moved to the To Do List
var card = new Notification(notification).movedCard("To Do");
//Copy the card to the top of the Started list in the Work In Progress Board
//and link the two cards to each other
card.attachLink(
card
.copyToList(new Trellinator().board("Work In Progress").findOrCreateList("Started"),"top")
.attachLink(card.link())
.link()
);
}
function synchChecklist(notification)
{
var notif = new Notification(notification);
//If a user other than Trellinator took this action
if(notif.member().notTrellinator())
{
//Get a completed checklist item
var completed = new Notification(notification).completedChecklistItem();
//Complete the same item in the first card linked in the attachments
completed.card().cardsLinkedInAttachments().first().checkItemByName(completed.name());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment