Skip to content

Instantly share code, notes, and snippets.

var created = new Notification(notification).createdCard(/Orders.*/);
var holding_list = created.board().list("Waiting ... ");
created.board().list("Transporters").cards().each(function(card)
{
Card.create(holding_list,"RFQ Order #"+created.id()).postComment(
//include whatever info from the order card here, just putting description as an example
//which might have all the form field submissions
"@to "+card.name()+" "+card.description+"\n"+created.description()
);
@iaindooley
iaindooley / gist:081e46150e897b57b380e0a19019bfeb
Created September 27, 2021 23:15
setDueDateOnConvertedCard
var created = new Notification(notification).convertedChecklistItemToCard();
//Set the created card due to the date of the linked item in the source checklist
created.setDue(
conv.source.item(conv.link()).due()
);
@iaindooley
iaindooley / gist:6be5d093f1c06018123506ce4e8a12bd
Last active September 27, 2021 05:55
createCardWithChecklistAndItems
console.log(
Card.create(
new Trellinator().boards().first().lists().first(),
"Hi there"
)
.addChecklist("My Checklist",function(cl)
{
cl.addItem("one");
cl.addItem("two");
cl.addItem("three");
@iaindooley
iaindooley / gist:fc2dcee1feb30f6fbb2934f4d2aa93b3
Created September 25, 2021 04:22
setCustomFieldToNextChecklistItem
var checked = new Notification(notification).completedChecklistItem();
var next = checked.checklist().itemAfter(checked);
checked.checklist().card().setCustomFieldValue("Next Action",next.name());
new Notification(notification).addedLabel("Remove All Attachments").card().attachments().each(function(att)
{
att.remove();
});
@iaindooley
iaindooley / gist:f40f9fb431fc1109e1615dcf4e2fdadf
Created September 24, 2021 05:52
updateChecklistItemDatesBasedOnDueDate
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));
});
@iaindooley
iaindooley / gist:b70d94d908eabfc93e8ec6bc5c529fa0
Created September 24, 2021 05:19
addMemberFromEnvironment
//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")}));
@iaindooley
iaindooley / gist:79e9b584f91846d442a4d9ad6f2018c2
Created September 24, 2021 05:15
prependNameAndAssignLabel
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());
});
var arched = new Notification(notification).archivedCard();
if(arched.currentList().name() == "Doing")
arched.board().list("My Tasks").cards().random().moveTo("Doing","top");
new Trellinator().board("My Tasks").list("To Do").cards().random().moveTo("Doing","top");
___queue.put(
"randomlySelectTasks",//the action to run
{},//optional parameters passed into the next execution
Trellinator.now().addDays(1).at("7:00")//the time to run next
);