My Alfred Trello Workflow

This post could also be called “why is it so hard to find information on programmatically creating items in Trello”? or “why are the Trello python modules so awful”?

What I was looking to do was create an Alfred workflow that would allow me to create a new item in an existing Trello list.

When you type in “backlog” into Alfred without any options, it’ll just open the Trello website, but if you type “backlog and the title” into Alfred, it’ll create a card with that topic in your Backlog list.

To get the data into the list, I used a simple python script that looks like this:

#!/usr/bin/env python

import requests
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--name', required=True, help='name of the card')
parser.add_argument('--description', default='' , help='description of the card')
args = parser.parse_args()


url = ""
querystring = { "idList":idList,
               "desc": args.description}

response = requests.request("POST", url, params=querystring)
# print(response.text)

The api_key and token can be found here. and the idList value can be found by doing a query of the board that your list is on.

# get the idList variable from this
response=requests.get("{}&token={}".format(api_key, token))

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s