Is it possible to have Trello select a random card from a board?
Asked by Patti B:

I'm using Trello to manage a fairly large list of small tasks. I would love to have a Trello board that functions as a job jar, and just have it choose one of the cards and hand it to me. Does something like this already exist? Is it something that could be done with Butler?  

Assuming the answer is no, would power-ups be a good tool for implementing this? I'm a software engineer, and even though I'm crap at front-end work I could probably muddle my way through the process.


Answers:
author: Iain Dooley
body: [@Patti B](/t5/user/viewprofilepage/user-id/3949944) This Butler command would do it:

![2020-06-02 at 11.18 pm.png](https://community.atlassian.com/t5/image/serverpage/image-id/97409i0586BE714BE5EEAD/image-size/large?v=v2&px=999 "2020-06-02 at 11.18 pm.png")

comments: author: Patti B
body: Thank you!   

Do you know if it's possible to turn that into a push-button operation? I kind of want to turn it into a task pellet dispenser.   

(Button) Reorganize the silverware drawer.  

... done. What next?  

(Button) Wash the living room windows.


author: bs
body: You could create a board button and tell it, on being pressed, to move a random card selected from a list to another list. That should do it?


author: Iain Dooley
body: [@Patti B](/t5/user/viewprofilepage/user-id/3949944) also it looks like you might be doing tasks that are kind of "recurring maintenance". I use this for my home maintenance board:

![2020-06-03 at 12.00 pm.png](https://community.atlassian.com/t5/image/serverpage/image-id/97480iA3E0A1486B06A81C/image-size/large?v=v2&px=999 "2020-06-03 at 12.00 pm.png")The tasks look like this:

![2020-06-03 at 12.03 pm.png](https://community.atlassian.com/t5/image/serverpage/image-id/97481i86C29A79EBBB1530/image-size/large?v=v2&px=999 "2020-06-03 at 12.03 pm.png")

As you can see the things that have been done the least recently all sit higher up in the list, I pick something, do it, then mark the due date as complete and it moves to the bottom of the list.


author: Patti B
body: [@bs](/t5/user/viewprofilepage/user-id/1871579) That is very close to what I want. Thank you! If I can figure out how to have it choose from multiple lists then it will be perfect. I suppose I could restructure into a single list with labels but that defeats the purpose of having lists.  

Off to documentation and references I go...  

<br />

[@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) It's for managing a large backlog of tasks, some of which are recurring maintenance.  

I'm ADD, and things tend to pile up. Staring at a large list of tasks paralyzes me-- the whole thing seems insurmountable, so I just don't do anything. I want to just have lists of small tasks broken down by category (e.g. kitchen, the storage room, whatever) then when I have time I want a system to hand me a task without my having to think about what it is. The best analog is an old-fashioned job jar with slips of paper in it, but with a better interface for managing the slips of paper.


author: Patti B
body: To follow up on this, I've solved the problem with a Chrome plugin that gets a list of all the cards on the current screen and randomly opens one. I started down the path of writing it myself then remembered that I'm a back-end girl and my eyes glaze over whenever I have to deal with UI, so I outsourced it.  

Thank you all for the excellent feedback and suggestions!

comments: author: mckenziesue2
body: What was the Chrome plugin/extension that you found worked for this? I am looking for the ability to move a random card from the entire board or to randomly open a card from the entire board. Hoping your Chrome plugin works for me too!


author: Patti B
body: I commissioned it from someone on Fiverr, and share it selectively.


author: Brian Miglionico
body: Is it possible to shar this or to share the individual you commissioned for the task?

Thanks


author: Patti B
body: [@Brian Miglionico](/t5/user/viewprofilepage/user-id/4534195) Contact me at pattib at pattib dot oh-or-gee.


author: Patti B
body: (smacks self in forehead)  

There are two obvious solutions:  

#1: Whip up a Greasemonkey script  
#2: Use the API and toss a simple webpage somewhere that lets me push buttons and get task pellets

comments: author: Iain Dooley
body: [@Patti B](/t5/user/viewprofilepage/user-id/3949944) if you're going to use the Trello API, you might like this open source thing I wrote:

<https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271>

You could have it recur every day, for example. You can see tonnes of example code here that I've posted to the community:

<https://gist.github.com/iaindooley>


author: Patti B
body: Thank you!


author: Iain Dooley
body: [@Patti B](/t5/user/viewprofilepage/user-id/3949944) [@bs](/t5/user/viewprofilepage/user-id/1871579) I just got a bump on this post so though I'd update you that we have just launched scheduled actions on the BenkoBot site. Patti, BenkoBot allows you to run API code using the Trellinator library I linked to above:

<https://app.benkobot.com/>

This code would randomly select one card from a list and then schedule itself to run again at 7am the next day:

<https://gist.github.com/iaindooley/96c31bbffbc1675e1c8b4852526085e4>

[This link will install it in BenkoBot as an Action](https://app.benkobot.com/addadhoc?adHocCodeName=randomlySelectTasks&code=bmV3IFRyZWxsaW5hdG9yKCkuYm9hcmQoIk15IFRhc2tzIikubGlzdCgiVG8gRG8iKS5jYXJkcygpLnJhbmRvbSgpLm1vdmVUbygiRG9pbmciLCJ0b3AiKTsKCl9fX3F1ZXVlLnB1dCgKICAicmFuZG9tbHlTZWxlY3RUYXNrcyIsLy90aGUgYWN0aW9uIHRvIHJ1bgogIHt9LC8vb3B0aW9uYWwgcGFyYW1ldGVycyBwYXNzZWQgaW50byB0aGUgbmV4dCBleGVjdXRpb24KICBUcmVsbGluYXRvci5ub3coKS5hZGREYXlzKDEpLmF0KCI3OjAwIikvL3RoZSB0aW1lIHRvIHJ1biBuZXh0Cik7)

(you'll need to enter your API key/token first but you can preview the code before you save/run it). You'll need to update the name of your board/list etc. or modify where gets the tasks from to your liking.

Alternatively you could trigger the next one to be selected when you archive the card you're currently working on:

<https://gist.github.com/iaindooley/0a0fd4504d498bf2c3d352be9c0fa2d2>

[This link will install it in BenkoBot as a Trello Listener](https://app.benkobot.com/addlistener?functionName=getNextTask&code=dmFyIGFyY2hlZCA9IG5ldyBOb3RpZmljYXRpb24obm90aWZpY2F0aW9uKS5hcmNoaXZlZENhcmQoKTsKCmlmKGFyY2hlZC5jdXJyZW50TGlzdCgpLm5hbWUoKSA9PSAiRG9pbmciKQogIGFyY2hlZC5ib2FyZCgpLmxpc3QoIk15IFRhc2tzIikuY2FyZHMoKS5yYW5kb20oKS5tb3ZlVG8oIkRvaW5nIiwidG9wIik7)

After you enter your API key/token you'll see the code and can edit the list names and so on, you can also choose on which boards it should run.


author: btrambzz
body: Thank you Iain, the automatic random task chooser on archiving event works like a charm!

I'm the kind of person that used to take way too many decisions in his career and I'm now pleased to get driven by organized random choices :)

Bertrand (from France)