trello-task-scrubber
v1.0.3
Published
Scrubs Trello cards from one list and moves the results to another list.
Downloads
9
Readme
Trello Task Scrubber
Trello Task Scrubber is a script that essentially moves Trello cards from one list to another list within the same board. In the process it performs the following tasks:
- Add any labels found in the card name
- Adds a due date if there is one in the card name
- Adds me as a card member.
Getting Started
To execute the script, you must first get an API key and an authorization token. Follow the steps below to setup and execute the script:
- Visit this page to get an API key and save it somewhere safe
- Use this link
https://trello.com/1/connect?key=<PUBLIC_KEY>&name=Trello%20Task%20Scrubber&response_type=token&scope=read,write&expiration=never
as a template for your authorization page
- Replace <PUBLIC_KEY> with the key obtained in step 1
- You can change the expiration if you don't want a permanent token
- You must leave the scope, this script requires read/write access
- Visit the authorization page using the URL built from step 2, after approving the return value should be the authorization token, save this token somewhere safe.
- Get the board id, source list id, and destination list id, see instructions below, and save these somwhere save
- Install the script using
npm install trello-task-scrubber -g
- Set the following environment varibles:
- TrelloKey - Your API Key
- TrelloToken - Your authorization token
- TrelloScrubberSourceList - The id of the list cards will be retrieved from
- TrelloScrubberDestinationList - The id of the list cards will be moved to
- TrelloScrubberBoardId - The id of the board that houses both lists
- Execute the script using
trello-task-scrubber
- To view help execute
trello-task-scrubber -h
Getting list and board ids
- In a webpage, go to the Trello board and list whose ids you want
- Open a card from that list
- In the address bar, add
.json
to the end of the URL and hit enter - Search for the
idList
property to get the list id - Search for the
idBoard
property to get the board id
Why
This script is the first in a small suite of tools I plan to create to automate parts of my daily task management. I use a Trello board to manage random tasks that I need to get done; things like "Clean bedroom" or "Call mechanic". The board has categorical labels such as "Home" for things that need to be done around the house and "Finance" for money related tasks. For tasks that are time sensitive, I also add a due date to the card. I prefer to add labels and due dates when creating the card.
One of the requirements for my task management system is a minimal number of steps to create the card, add labels, add due dates and add myself as a member. With the Trello for Android app, I have to open the app, then open the board, then navigate to the "Incoming" list then create the card. After that I have to then open the card to add myself as a member, add any labels, and add a due date. There is also a "Create Card" Android widget that Trello provides, but I still need to go into the app to add myself as a member, add any labels, and add a due date. Personally, this is too many steps for adding a single card.
My Solution
My solution to this problem is two-fold. The first part (creating the cards) is a manual process. This simply cannot be automated. The second part (scrubbing) is automated by this script.
Creating cards
To get the minimum number of steps for creating a card, I am using the DO Note application by IFTTT. I have a recipe that takes the contents of the note and creates a new Trello card with the contents being the card name. The recipe creates a new card in my "Daily Tasks" board in the list "Incoming from DO Note". The note contents contain the card name, any labels delimited by the "#" symbol and a due date delimited by the "@" symbol. For example, if I wanted to create a card named "Deposit paycheck" with the label "Finance" due on "June 25, 2016 at 4:00 PM", the DO Note contents would look like the following: "Deposit paycheck #Finance @2016-06-25;4:00PM"
Scrubbing cards
For lack of a better word, I use the term "scrubbing" to describe the process of taking the cards created by DO Note and applying labels, due dates, members moving to a new list. The process of how this is done is described below, I just want to note in this section, that to make this truly automatic, I have a cron job on a raspberry pi that executes this script every night.
What
When you execute this script, it looks for cards in a specific Trello list. If any cards are found they run through a specific process before moving to a new Trello list. The process looks like the following:
- Parse the name for labels and a due date. Labels are denoted by
#
and due dates are denoted by@
- If there are any labels, add them to the Trello card via the API.
- If there is a due date, set the due date on the Trello card via the API.
- Strip the labels and due date from the name and update the Trello card's name
- Move the card from the source list to the destination list.