I would like to find existing cards that contain a particular word in the description (ie. triads, scales) and assign a label based on the word found - so cards with the word "triad" are assigned the "orange triad" label.
Seems easy enough... search/ filter based on a word, then add the label to the card - however I can't figure out how to do this in Butler.
I am able to use Butler to do this for new cards, however not sure how to do it on existing cards. Thanks in advance for you help.
Hello @Ken K
No, you can't do that with Butler. If you create a rule with a Card Content trigger where the description contains certain text, on the page you will see the following warning message:
Note: This will only trigger when you create or modify a card's name or description. It will not work retro-actively for existing cards on the board, or for other members on the board (unless they create and enable their own rule).
This sort of advanced action might be possible with Benkobot.
@David Bakkers thanks :)
@Ken K this would do it in BenkoBot you can save it as an "ad hoc" function and then edit the word to run it for each time, you'll also need to update your board name:
Thanks for the note @Iain Dooley
I don't know much about benkobot yet but your code looks pretty straight forward. I put the board name "Lesson Log" in the quotes.
I added the code in the AdHoc entry box and clicked Run. It goes for a bit, but returns without actually updating any cards.
Can you explain how the code knows which label to apply? Is there something else I might be overlooking (I've never used this).
I was expecting to see the cards that have "Triad" in them with a new Triad label.
Sorry for the total newbie experience. I appreciate your help.
Thanks @Iain Dooley - I totally appreciate your help...
Awesome - it worked! You rock!!
I noticed it created a new colorless label. Is there a way in the code to assign a color to the label? Or is there a way to assign an existing label?
If it's in the docs, just tell me and I'll dig in (just figured you'd know off the top of your head).
Great stuff!! Thanks again!! Saved me hours!!!
@Ken K yeah it just defaults to no colour, you can easily edit the labels to add colours and later it will re-use the same one.
Of course it just uses the Trello API under the hood so you could craft the API call you want yourself to add a label with a colour, eventually it will make it into the Trellinator library ;)
Note that you get 10 free execution minutes per month on the free plan (which you're automatically subscribed to).
Scheduled adhoc functions, library functions and global command groups coming soon to a bot near you!
@Ken K there are also examples of "listeners" and other adhoc code snippets on this board, as well as a developer crash course and we will keep adding stuff here:
@Iain Dooley Thank you so much. This was exactly what I needed. My board just became 10x more valuable to me!
I was able to edit the label easily - it just threw me at first because I didn't realize the label had been applied. Killer stuff.
I will definitely check out the resources and try to get my head around the whole benkobot interface. Incredibly helpful and I'm very grateful Iain.
Sorry to bother you Iain... I tried running the same code using an existing label.
Rec'd this error in the console...
https://api.trello.com/1/cards/6107939cfe2a253a3162e1d2/idLabels with status code 400:
Should I be able to use an existing label? Perhaps I misunderstood your comment about "re-using the same one".
My intent is to apply the same label on cards containing different text strings (ie. Triads, 351, 513, etc) all getting the same label. To do this, I'm running the script multiple times (with new search strings). It chokes when trying to use the same label name.
Thanks in advance!
Hi Iain - finally getting back to this - thanks for the reply. I still get the error but the script is definitely working. There's not much else than what I wrote above. I wonder if I'm not letting it finish and that's why I'm getting the error.
Either way things are great - thanks again!
Congratulations to @Laura Holton , our latest winner of Taco Tuesday! And thanks to @Kristján Geir Mathiesen for sharing the picture of Taco having fun with his new friend B...
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