Created
October 25, 2018 12:06
-
-
Save iaindooley/5b4f7cbd3e3c4bfe7ad94a5e7abdb7cc to your computer and use it in GitHub Desktop.
Trellinator Quick Start Projects Overview Demo
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 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