A python script that pushes Close.io opportunities to a Trello board.
- Looks at the Trello board to see if any cards have moved on the board.
- If a Trello card has moved, the opportunity status will be updated in Close.io.
- Looks for any Close.io opportunities that have been updated in the past 24 hours.
- Checks to see if the string
trello_card_id: {CARD_ID}
is on the opportunity note. - If the string exists, the script will update the existing card on the Trello board.
- If the string does not exist, the script will create a new card and place it in the correct list on the Trello board.
Requirements:
- Virtualenv
- pip install library
- Access to Close.io and Trello API credentials
Running the script:
- Clone the repository from Github.
- Navigate to the repository folder in Terminal:
cd closeio-trello-sync
- Open the
credentials.py
file in your text editor to make sure the correct API keys are filled in. - Install and create a virtual environment:
virtualenv venv
- Run the virtual environment:
source venv/bin/activate
- Install the script's libraries:
pip install -r requirements.txt
- Run the script:
python closeio_trello_sync.py
Your most recently updated opportunities should be on your Trello board!
First time installation:
- In Terminal, SSH into the droplet as the root user:
ssh root@IP_ADDRESS
- Use the droplet root password found in the project documentation.
- Go up one directory level:
cd ..
- Clone the repository from Github.
- Navigate to the folder:
cd closeio-trello-sync
- Open the
nano credentials.py
file in your text editor to make sure the correct API keys are filled in. - Install the script's libraries:
pip install -r requirements.txt
- Run the script:
python closeio_trello_sync.py
Running the script:
- In Terminal, SSH into the droplet as the root user:
ssh root@IP_ADDRESS
- Go up one directory level:
cd ..
, typels
to view the directory's contents. - Navigate to the folder:
cd closeio-trello-sync
- Run the script:
python closeio_trello_sync.py
Setting up the script to run every 15 minutes via cron job:
- Once logged into the droplet, enter the crontab view:
crontab -e
- Add the line:
*/15 * * * * python /closeio-trello-sync/closeio_trello_sync.py
- Save the new crontab file with
Cntrl
+O
, and exit withCntrl
+X
. - You should see that the new crontab file was updated.
Updating the repository code on DigitalOcean:
- Once logged into the droplet, nagivate to the
closeio-trello-sync
folder. (cd ..
,ls
) - Pull the newest code from Github:
git pull origin master
- Enter your Github credentials.
- The code should pull the latest update.
- Test the script by running:
python closeio_trello_sync.py
- DO NOT delete Trello cards from the board UNTIL you do it in Close.io first. If you have an existing opportunity with
trello_card_id:{TRELLO CARD ID}
in the note, the script will break because it won't find the existing card to update. - Make sure the opportunity note ends with
trello_card_id: {TRELLO CARD ID}
. - Deleting a Close.io opportunity will not delete the Trello card.
- If you created or updated an opportunity and don't see it on the Trello board, it may not have a matching opportunity status. If the script can't find a matching list on the board to the opportunity status, it will alert you in the Terminal output.
- If the script can't find a matching Trello list to put the card in, it will put it in the CLEANUP list. Then you can delete the card or move it to the appropriate place.