Skip to content

Instantly share code, notes, and snippets.

@Aschen
Last active September 10, 2025 10:04
Show Gist options
  • Select an option

  • Save Aschen/fb3eb592b1633264446de03f4343b7d0 to your computer and use it in GitHub Desktop.

Select an option

Save Aschen/fb3eb592b1633264446de03f4343b7d0 to your computer and use it in GitHub Desktop.
Get random card from a Trello board

Shuffle Trello : Pick a random card in a column

This small script pick a random card in a column on a Trello board.

We use this script at Kuzzle to pick a random card for our product workshop.

Usage

Change the number of the column from which you want to take a random card. For example to pick a card in the first column of the board:

var column = 1;
fetch(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children[Math.floor(Math.random() * Math.floor(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children.length))].getAttribute("href")).then((data) => {document.location = data.url })
// original script from https://github.com/alexandrebouthinon
// Column number to shuffle (From left to right, Trello start with column number 1)
var column = 2;
fetch(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children[Math.floor(Math.random() * Math.floor(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children.length))].getAttribute("href")).then((data) => {document.location = data.url })
@Aschen
Copy link
Author

Aschen commented Sep 10, 2025

Yes most likely :-) The script is quite old and we don't use it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment