Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build dashboard
//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
You can’t perform that action at this time.