Skip to content

Instantly share code, notes, and snippets.

View gist:ee64dd680d1991ede55aa5cb7ef843bd
Logger.log(
new IterableCollection(
TrelloApi.get('token/YOURTOKENHERE/webhooks')
)
.first()
.callbackURL
);
View gist:c344cc62c08858736ce18e8cf920c44e
function myFunction(notification)
{
var ret = false;
try
{
var payload = JSON.parse(notification.postData.contents);
//this function should inspect the notification somehow
if(isShopifyNotification(payload))
View gist:379478c8c950735725efc7bd3ef8967e
//when a card is created in a list ...
var created = new Notification(notification).createdCard();
//loop through all the "overview" cards
new Trellinator().board("Onboarding Overview").cards().each(function(card)
{
try
{
//copy the created card to the list of the same name in the linked board
created.copyToList(
card.cardsLinkedInAttachments().first().list(created.currentList().name()),
View gist:c9683d0f9487d008c8656941ea8f2840
//when a card is created in a list ...
var created = new Notification(notification).createdCard();
//copy the department template board based on list name
var new_board = new Trellinator()
.board(created.currentList().name()+" Department Onboarding Template")
.copy(new Date().butlerDefaultDate()+" "+created.currentList().name()+" Department Onboarding");
//now copy all the lists from the company level template
new Trellinator().board("Company Onboarding Template").lists().each(function(list)
{
list.copy().move(new_board,"top");
View gist:f2a188f45e31aa6c38de0247e88a97ac
const created = new Notification(notification).createdCard(/Inbox/i);
created.board().cards().each(function(loop)
{
if((loop.id() != created.id()) && (loop.name().toLowerCase() == created.name().toLowerCase()))
{
created.attachLink(loop.archive().link());
}
});
View gist:55e20a0cb6d4de36d8f101183346cba6
var datefieldname = "My Date Field";//update to the name of your actual field
var target_list = "My List";//update to the name of your actual list
////DON'T EDIT BELOW THIS LINE////
var changed = new Notification(notification).changedCustomField();
if(changed.name() == datefieldname)
{
Card.create(
changed.card().board().list(target_list),
View gist:b9588d024f859b46518c24520e4e07c3
var created = new Notification(notification);
created
.board()
.card("Checklist Templates")
.copyUniqueChecklist(created.currentList().name(),created,"top");
View gist:1f05a078310d950cdd492c20cc922c50
new Trellinator().board("My Board")//UPDATE WITH YOUR BOARD NAME
.cards()
.each(function(card)
{
card.checklists().each(function(cl)
{
cl.items().each(function(item)
{
item.markIncomplete();
})
View gist:89c0a8d6f305de471df030da950b6624
new Notification(notification).addedChecklist().setPosition("top");
@iaindooley
iaindooley / gist:0e3bef8e8b665a9edbeb730d654a5c84
Created May 26, 2021
Re-archive everything from a board
View gist:0e3bef8e8b665a9edbeb730d654a5c84
var target = Board.findOrCreate("TEMP").findOrCreateList("TEMP");
Trellinator.searhCardsInBoards(new Trellinator().board("My Board"),"is:archived",1000)
.each(function(card)
{
card.unArchive().moveToList(target,"top").archive();
});