Instantly share code, notes, and snippets.

View remind_due_soon
function scheduleDueDateReminder(notification)
{
new Notification(notification).actionOnDueDateAdded("actionDueDateReminder",function(date)
{
date.minusHours(1);
});
}
function actionDueDateReminder(notification)
{
View gist:949a12ba85d42af059215da3f5c55336
function backupBoard(notification)
{
var notif = new Notification(notification);
notif.addedLabel("Trigger Backup");
var new_board = Board.create(notif.board().name()+" "+Trellinator.now().toLocaleString()+" backup");
notif.board().lists().each(function(list)
{
list.copy().move(new_board);
});
View add_remove_yellow
function addYellowLabel(notification)
{
new Notification(notification).addedCard("Waiting").addLabel("Yellow");
}
function removeYellowLabel(notification)
{
var notif = new Notification(notification);
notif.addedCard("Done").removeLabel(notif.card().label("Yellow"));
}
View move_completed_checklists
function moveCompletedChecklistsToLinkedCard(notification)
{
var notif = new Notification(notification);
if(!notif.member().notTrellinator())
throw InvalidActionException("Only take this action for user completed checklists");
var completed = notif.completedChecklist();
try
View delete_checklist_when_completed
function deleteCompletedChecklist(notification)
{
new Notification(notification).completedChecklist().remove();
}
View move_and_rename_with_hashtag
function moveAndRenameCardWithHashtag(notification)
{
var notif = new Notification(notification);
if(parts = /(.+) #(.+)/ig.exec(notif.createdCard("Inbox").name()))
notif.card().moveToList(notif.board().findOrCreateList(parts[2])).setName(parts[1]);
}
View set_due_on_list_move
function setDueIn24Hours(notification)
{
new Notification(notification).movedCard("List one").setDue(Trellinator.now().addHours(24));
}
function setDueIn48Hours(notification)
{
new Notification(notification).movedCard("List two").setDue(Trellinator.now().addHours(48));
}
View mirror_attached_file
function mirrorAttachedFile(notification)
{
var notif = new Notification(notification);
if(notif.member().notTrellinator())
{
var file = notif.attachedLink();
file.card().cardsLinkedInAttachments().first().attachLink({name: file.text(),link: file.link()});
}
}
View add_due_date_to_emails
function addDueDateToEmailedCard(notification)
{
new Notification(notification).addedCard("Emails in").setDue(Trellinator.now().addHours(24));
}
View 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();