Skip to main content

slack-to-trello

Build Status

Perform Trello actions via slash commands in Slack

The current iteration is a proof of concept; only 1 Slack team, 1 Trello user, and 1 Trello list is supported at the moment. In the future, we would like to support multiple teams and boards via an OAuth integration with Trello (to connect Slack users to Trello users) and some mechanism to select board (either from Slack or a mapping on the server).

Convert

/trello slash command

into

/trello response message

Getting Started

To get a copy of slack-to-trello running, please follow the steps below:

# Clone our repository
git clone https://github.com/underdogio/slack-to-trello
cd slack-to-trello/

# Install our dependencies
pip install -r requirements.txt

# Install our module as a dependency of itself (meta)
python setup.py develop

# The remaining steps are for setting up our configuration
# We will be building `slack_to_trello/config/env`
# We start by copying `env.test`
cp slack_to_trello/config/env.test slack_to_trello/config/env

# Create 2 Slack integrations (1 for receiving slash commands, 1 for sending messages)
# First Slack integration: Slash Commands
#   Open your browser to Slash Commands
#   https://my.slack.com/services/new/slash-commands
#   Command: "/trello"
#   URL: "https://my-server/slack/message"
#     Please replace `my-server` with your server location
#     Don't forget to host it on HTTPS
#   Method: "POST"
#   Token: Provided by Slack
#   Autocomplete -> Description: "Add a Trello card on the Engineering board"
#   Autocomplete -> Help text: "[card subject]"
#   Descriptive Label: "slack-to-trello"
#   Click "Save Integration"

# Once saved, add the "Token" field as `SLACK_TOKEN` into `env`
#   `export SLACK_TOKEN=token_from_slack`

# Second Slack integration: Incoming WebHooks
#   These will be replies upon successful Trello card additions
#   Open your browser to Incoming WebHooks
#   https://my.slack.com/services/new/incoming-webhook
#   Post to Channel: Pick any channel -- we will always be overriding this
#   Webhook URL: Provided by Slack
#   Descriptive Label: "slack-to-trello messages"
#   Customize Name: "slack-to-trello"
#   Customize Icon: Pick any you like -- we recommend `:signal_strength:`
#   Click "Save Settings"

# Once saved, add the "Webhook URL" field as `SLACK_MESSAGE_URL` into `env`
#   `export SLACK_MESSAGE_URL=https://hooks.slack.com/services/path/to/reply`

# Set up our Trello integration
#   We recommend creating a bot user as all cards
#   will be marked as "Created by" the chosen user

# Collect our Trello API information
#   Open our browser to https://trello.com/app-key
#   Save "Key" as `TRELLO_API_KEY` in `env`
#   `export TRELLO_API_KEY=value_from_key`

# Generate a permanent Trello API token (this can be disabled later on)
#   Using the "Key" as "TRELLO_API_KEY" and "Secret" as "TRELLO_API_SECRET"
TRELLO_API_KEY=key_from_website TRELLO_API_SECRET=secret_from_website bin/generate-trello-tokens.py
#   You will be prompted to open a link
#   Follow the link and click "Accept"
#   Copy the standalone value from the page
#   Go back to the command line and enter "y"
#   You will be prompted for a PIN
#   Paste the value from the page
#   You will be given an `oauth_token` and `oauth_token_secret` value

# Save `oauth_token` as `TRELLO_TOKEN` in `env`
#   `export TRELLO_TOKEN=value_from_oauth_token`

# Find the board/list we want to add cards to
# List our boards and their ids via:
bin/list-trello-boards.py [TRELLO_API_KEY] [TRELLO_TOKEN]
# Find the board we want and record its id as `TRELLO_BOARD_ID` in `env`
#   `export TRELLO_BOARD_ID=target_board_id`

# Output the board lists and their ids via:
bin/list-trello-board-lists.py [TRELLO_API_KEY] [TRELLO_TOKEN] [TRELLO_BOARD_ID]
# Find the list we want and record its id as `TRELLO_LIST_ID` in `env`
#   `export TRELLO_LIST_ID=target_board_id`

# Start our server (default port is 5000)
./run.sh
# An alternative port can be chosen via the `PORT` environment variable
# PORT=6000 ./run.sh

# You should now be able to send a `/trello` command in Slack

Documentation

Testing

Our tests are powered via nosetests but require specific environment variables to be set up before hand. To run our tests, follow the steps below:

# Install our development dependencies
pip install -r requirements-dev.txt

# Run our tests
./test.sh

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via ./test.sh.

License

Copyright (c) 2015 Underdog.io

Licensed under the MIT license.

Metadata

Release files for slack_to_trello 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for slack_to_trello 1.0.0
File Size Uploaded
slack_to_trello-1.0.0.zip 19.7 kB Details
slack_to_trello-1.0.0.tar.gz 11.8 kB Details

Release files / slack_to_trello-1.0.0.zip

Download URL slack_to_trello-1.0.0.zip
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8967d84d28c620fe7bbf5a15f8a2104b398ab399a6b3c0a36c7d65a45604942b
BLAKE2b-256 checksum
How to use checksums
4bc632a807403cce5efcd900c5914d563852945f8882e58835f631fc126eae56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / slack_to_trello-1.0.0.tar.gz

Download URL slack_to_trello-1.0.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d7c56d9791b538dea16dfe3d6917ca2a2cb16ecb3d839f898f43d53d3a45dd98
BLAKE2b-256 checksum
How to use checksums
7dcf135ade6dae7c546cbd30f034f03235329fbcecb5cec5b5dbc20bc6e922af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page