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
var checked = new Notification(notification).completedChecklistItem(); | |
var next = checked.checklist().itemAfter(checked); | |
checked.checklist().card().setCustomFieldValue("Next Action",next.name()); |
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
var card = new Notification(notification).addedDueDate(); | |
copied.checklists().first().items().each(function(item) | |
{ | |
var diff = item.due().getTime() - card.previouslyDue().getTime(); | |
item.setDue(new Date(card.due()).addSeconds(diff)); | |
}); |
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
//When a card is moved to the Doing list | |
var moved = new Notification(notification).movedCard(/Doing.*/i); | |
moved.addMember(new Member({username: ___persistence.get("Support Co-ordinator")})); |
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
var created = new Notification(notification).this.convertedChecklistItemToCard(); | |
created.setName( | |
created.source.card().name()+" "+created.name() | |
); | |
create.source.card().labels().each(function(label) | |
{ | |
created.addLabel(label.name()); | |
}); |
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 createLinkedCard(notification) | |
{ | |
var added = new Notification(notification).addedLabel().name(); | |
var target = new Trellinator().board(added.name()).list(/Inbox.*/i); | |
var copy = added.card().copyToList(target,"top"); | |
copy.attachLink(added.card().link()); | |
added.card().attachLink(copy.link()); | |
} |
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
var cardlink = "SHORTLINK";//get this from the "share" button on the card | |
var card = new Card({link: cardlink}); | |
var target = card.currentList(); | |
var prev = card; | |
for(var i = 0;i < 52;i++) | |
{ | |
var prev = card.copyToList(target,card.name()).setDue(prev.due().addDays(7)); | |
} |
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 downloadAllFiles(notification) | |
{ | |
var card = new Notification(notification).addedLabel("Download").card(); | |
var folder = DriveApp.createFolder(card.id()); | |
card.attachments().each(function(att) | |
{ | |
var file = Trellinator.downloadFileToGoogleDrive(att.link()); | |
folder.addFile(file); | |
}); |
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 sendSmsFromTrello() | |
{ | |
new Trellinator().board("My Contacts").cards().each(function(card) | |
{ | |
sendSms(card.customFieldValue("Mobile Number"),"Hi there "+card.customFieldValue("First Name")+"!"); | |
}); | |
} | |
//TAKEN FROM: https://www.twilio.com/blog/2016/02/send-sms-from-a-google-spreadsheet.html | |
function sendSms(to, body) { |
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 removeImages(notification) | |
{ | |
var moved = new Notification(notification).movedCard("Terminado y Cumplido"); | |
moved.attachments().each(function(att) | |
{ | |
if(/.*\.(jpg|png)/i.test(att.name())) | |
{ | |
att.remove(); | |
} | |
}); |
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 createCardsFromSheet() | |
{ | |
var vals = SpreadsheetApp.openByUrl("urlgoesbrrr").getSheets()[0].getDataRange().getValues(); | |
var list = new Trellinator().board("My Board").list("Inbox"); | |
for(var i = 0;i < vals.length;i++) | |
{ | |
Card.create(list,{name: vals[i][0],desc: vals[i][1]}); | |
} | |
} |