Skip to content

Instantly share code, notes, and snippets.

View gist:7fad62c325d6fd8782432f2b7cb63ea6
function populateNextList(notification)
{
//When a checklist is completed
var comp = new Notification(notification).completedChecklist();
var alldone = true;
//If all other checklists on all cards in the same list are also complete
comp.card().currentList().cards().each(function(card)
{
alldone = card.allChecklistsComplete();
});
View gist:dd42ccef801e4b14daf13e14005e62c3
new IterableCollection(
new Trellinator().board("iaindooley").list(/Coming up.*/i).cards().asArray().sort(function(a, b) {
return new Date(a.due()).getTime() - new Date(b.due()).getTime();
})
).each(function(card)
{
console.log(card.name()+" - "+card.link()+"\n");
});
View gist:87621ff4830c878b07c063304b1000a1
function privateCards(notification)
{
var created = new Notification(notification).createdCard();
created.copyToList(new Trellinator().board("My Private Board").findOrCreateList("New Feedback"),"top");
created.del();
}
View gist:62fe141876d23d79469da792db96ce4b
var b = new Trellinator().board("My Board");//change the name here
var l1 = b.list("Target 1");//change the names of your lists
var l2 = b.list("Target 2");
b.list("My List").cards().each(function(card)//change the name of your list
{
try
{
card.label("Label 1");//move cards with Label 1 into list 1
card.moveTo(l1);
View gist:7372f6bd7c8106392e3f27487b719f64
function importFromSpreadsheet()
{
var vals = SpreadsheetApp.openByUrl("your sheet").getSheets()[0].getDataRange().getValues();
var target_list = new Trellinator().board("Your Board").list("Inbox");
for(var i = 0;i < vals.length;i++)
{
Card.create(target_list,{name: vals[i][0],desc: vals[i][1]})
.setDue(new Date(vals[i][2]))
.setCustomFieldValue("Company Name",vals[i][3]);
View gist:9cbd520fea27b28a9e643a026db69624
function backupBoard(params,sig,original_time)
{
var all_backups = Board.findOrCreate("My Backups");
var to_backup = new Board(params);
var backup_name = to_backup.name()+" "+Trellinator.now();
Card.create(
all_backups.findOrCreateList(Trellinator.now().butlerDefaultDate()),
backup_name
).attachLink(to_backup.copy(backup_name).link());
View gist:bb1cc257ede60372905458f777e2f8a9
new Trellinator().board("My Board Name").lists().each(function(list)
{
console.log("List "+list.name()+":\n\n");
list.cards().each(function(card)
{
console.log(" - "+card.name()+" ("+card.link()+"): "+card.customFieldValue("Card Size")+"\n");
});
});
View gist:726d451e0efee270c8beee678077f5f2
var plugins = ["0ad9a09sdf8asdfa","adfa098dsfa0s9d8f","asdfa098fa0s9d8f"];//list of plugin IDs to enable
new Trellinator().boards().each(function(board)
{
for(var i = 0;i< plugins.length;i++)
{
TrelloApi.post("boards/"+board.id()+"/boardPlugins?idPlugin="+plugins[i]);
}
});
View gist:cc3e0e2dfaba16be576407fd013101f5
var labels = ["one","two","three"];
new Trellinator().boards().each(function(board)
{
var target_list = board.findOrCreateList("TEMP");
for(var i = 0;i < labels.length;i++)
{
Card.create(target_list,"TEMP").addLabel(labels[i]).archive();
}
View gist:82e600603fa363ab41257f55818e47c4
function copyOnComment(notification)
{
var notif = new Notification(notification);
var A = new Trellinator().board("Board A").findOrCreateList("A");
var B = new Trellinator().board("Board B").findOrCreateList("B");
var x = 0;
if(notif.member().notTrellinator())
{
notif.board().list("A").cards().each(function(card)
You can’t perform that action at this time.