I'm looking to convert some commands to Trellinator but am stuck with how to start coding :)
Basically I need to do a bunch of actions based on a change to a card. In this instance when a card is added to a specific list with some criteria set do the move and post a comment.
Is this something that Trellinator can do given the Butler command limit is low comparatively?
when a card without the green "Deposit Received" label is added to list "Accepted/ Waiting Deposit", set due in 3 working days, mark the due date as incomplete, move the card to the top of list "Accepted/ Waiting Deposit", and post comment "@reply Thank you for confirming that you would like to proceed with this job! "
@Keith this function does what you want:
except I noticed that the markDueDateIncomplete method isn't present in the "quickstart" sheet you copied initially, so copy this function to line 847 of apps/trellinator-lib/Card.gs in the script editor:
I see that "@reply" comment -- are you using BenkoBoard or BenkoDesk? That's also my product :)
If you go to here:
a good place to start is with the Notification class -- that's where most of your functions will begin if they're handling notifications. Scheduled commands are a bit trickier.
You can also see hundreds (maybe more than 1000) snippets and examples I've posted on the community here:
hey @Iain Dooley
thanks that works a treat. I've added in a whole bunch of functions already :)
I can't see any functionality on the docs in the notification class to return a card object once a label has been added.
I.e. label is added, update card with xyz
Is this available or done another way?
typically any notification that returns something other than a card will have a containing card set on it:
notif = new Notification(notification);
var card = notif.addedLabel("Whatevs").card();
var card = notif.completedChecklistItem().checklist().card();
var card = notif.attachedLink().card();
var card = notif.changedCustomFieldValue().card();
var board = notif.changedListName().board();
var board = notif.addedCard().board();
var board = notif.addedCard().list().board();
and so on. So each thing that gets returned will have a reference to it's container (checklist, card, list, board).
BTW what's with the "@reply" in your comment, are you using BenkoBoard/BenkoDesk??
@Keith oh i should also mention that those objects are available from the notification too:
notif.listBefore();//throws InvalidActionException if no list before
notif.listAfter();//throws InvalidActionException if no list after
You can use:
in your catch block so that if another exception is thrown (for example InvalidRequestException) that should cause processing to halt and be retried from the ExecutionQueue you don't catch and kill it.
hey @Iain Dooley
Thanks again for your help!
Can you spot why I can't get this card to move?
var notif = new Notification(notification);
var card = notif.addedLabel().card();
card.label("Deposit not required");
card.moveTo("Ready to Program","top");
Clearly I'm missing something obvious in how the methods etc are structured and interacted with.
@Keith one note: expectException will throw an exception if it's not what was expected. You would typically only use one of them, in this case you would expect an InvalidDataException which is thrown if you try to access a label that doesn't exist on a card, but you could also check both like this:
anyhoo, here's how I'd write that function:
Hello Community! My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. I'll be sharing with you a series of videos with my top tips on how to best use Trello...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events