Last active
May 11, 2019 20:12
-
-
Save iaindooley/450eea8a387df9dccf443b68f5d57040 to your computer and use it in GitHub Desktop.
Build dashboard
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
//SCHEDULE DAILY AT 5AM OR SOMETHING | |
function buildDashboard(params,signature,original_time) | |
{ | |
var mins = 10; | |
new Trellinator().boards().each(function(board) | |
{ | |
ExecutionQueue.push("buildDashForBoard",{dash_id: params.id,board_id: board.id()},signature+"-buildDashForBoard",new Date(original_time).addMinutes(mins)); | |
mins = mins + 10; | |
}); | |
ExecutionQueue.push("buildDashboard",params,signature,original_time.addHours(24)); | |
} | |
//THIS IS SCHEDULED BY THE ABOVE FUNCTION | |
function buildDashForBoard(params); | |
{ | |
var dash = new Board({id: params.dash_id}); | |
var board = new Board({id: params.board_id}); | |
board.cards().each(function(card) | |
{ | |
if(card.due() && (card.due().getTime() > Trellinator.now().minusHours(24).getTime())) | |
{ | |
card.members().each(function(member) | |
{ | |
Card.create(dash.findOrCreateList(member.name()),card.name()).attachLink(card.link()).setDue(card.due()); | |
}); | |
) | |
}); | |
dash.lists().each(function(list) | |
{ | |
list.sort(List.SORT_DATE_ASC); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment