Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created October 25, 2018 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/5b4f7cbd3e3c4bfe7ad94a5e7abdb7cc to your computer and use it in GitHub Desktop.
Save iaindooley/5b4f7cbd3e3c4bfe7ad94a5e7abdb7cc to your computer and use it in GitHub Desktop.
Trellinator Quick Start Projects Overview Demo
function setup()
{
var template = Board.create({name: "Project Template"});
var overview = Board.create({name: "Projects Overview"});
}
function createNewProjectBoard(notification)
{
var card = new Notification(notification).addedCard("To Do");
var trellinator = new Trellinator();
var new_board = trellinator.board("Project Template").copy(card.name(),trellinator.team("Projects"));
Trellinator.addBoardToGlobalCommandGroup(new_board,"Project Boards");
card.attachLink(new_board.link());
}
function cardStarted(notification)
{
var card = new Notification(notification).movedCard("Doing");
postCommentToOverviewCard(card.board(),"Started work on "+card.link());
}
function cardFinished(notification)
{
var card = new Notification(notification).movedCard("Done");
postCommentToOverviewCard(card.board(),"Finished work on "+card.link());
}
function postCommentToOverviewCard(board,comment)
{
new Trellinator().board("Projects Overview").cards().find(function(loop)
{
if(loop.boardsLinkedInAttachments().first().id() == board.id())
return loop
else
return false
}).first().postComment(comment);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment