Share your Butler-hacks. Here's an IF-Conditional

Vongsawat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2020

So I got it in to my fool head the other day, of trying to figure out how to hack a way in to getting Butler to do if-conditionals. And somehow came up with a super niche, limited way to get it to work!

So I wanted to start a discussion of any weird Butler-hacks people have come up with to eke out that extra bit of efficiency against the limitations of Trello and Butler they've got squirreled away for a rainy day.

Anyways, I'll start. Here's a basic IF-Conditional example:

When a card button Prepped is clicked
Copy over a Tasks checklist, and assign a random member
IF FastTracked customfield checkbox is checked
THEN Tag it as Urgent, and assign 2 more members

The Setup:
First, create a personal board and call it Conditionals, and make a card named Checked in it.
Then create a custom field checkbox called FastTracked in whatever board you're working in.
image.png

The Butlering:
Set up your Card Button. The bit in Blue is the Conditional.
image.png
What happens is that it tries to lookup a card that is named whatever value FastTracked is. With the checkbox, its either "Checked" or its "".

Given that there exists a Checked card, it'll look it up, then get on with tagging and adding members. But if FastTracked is unchecked, there is no card called "". And Butler doesn't like it when it can't find/lookup a card. The command run immediately comes to a screeching halt, and the rest of the run is skipped entirely.

Boom, instant if-conditional. You can't do an Else though, as it relies on crashing out of the command run. But if you're running through a multiplier like "For Each Card" however, it'll only crash out of that one branch, and will continue on to work through all the other cards!

As an extra, though I haven't tested it yet, I'm pretty sure this also works on other custom field types. You just have to create a card on the Conditionals board for every acceptable value. Operators like >= are still out of reach, but you can have things like if Y is an integer between 2 and 10 by just creating every integer in between on the Conditionals board.

Super proud of all the time I wasted figuring this out :P Anyone else have Butler-hacks to share?

3 comments

Vongsawat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2020

Links
for the dabbler in Butler-fu: Variables , Lookups , Wildcards , Custom Fields, and Arithmetic  

Like Ari likes this
Vongsawat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2020

Numeric Conditionals
A non-trigger way to do greater-than, lesser-than, etc., portioning away part of the command for only if the condition was met.

If custom-field X is greater than Y, Do Things, else Do Nothing.

The entire logic chain rests on the fact that the Collect All Cards command can filter for cards with a custom field greater/lesser than (or equal to) a number. Outlined in Light Blue below.

The reason the rule below is so long, is just to make sure that when you Collect All Cards, you've narrowly defined it enough so that it will only choose the current card its triggering on. Which is the role of the Blue Butlering tag. That and cleaning up after itself. Technically, you only really need the one action itself, if you can narrowly define it well enough for other reasons, and don't mind random lists just lying about :P

Only the cards moved into ThisList that have the custom-field Value > 5 will have the Red ActedOn tagged on to it in the end.

Be careful to test out the command run in full though, as it can get rather long and Butler can decide its too long and cancel the command?? Didn't get that on these tests, but its happened before.

image.png

Vongsawat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2020

Butler trick: Different outputs for different Labels

Using a single rule that reacts differently depending on which label is attached. Targeting a different list or card or checklist. (they all have to be the same colour though)

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events