Automatically create comments on Trello, after a new git commit in bitbucket. Please note that this was created originally a couple of years ago to tackle the lack of a true broker integration between bitbucket and Trello. The original ticket that this attempts to tackle can be found here:
- Clone the repo
- Put the package.json and trello_commit.js files in the same folder anywhere in your file system (or leave them in the repo)
- Run npm install in the location of the trello and package.json files to get the dependencies
- Change the key and token at the top of the trello_commit.js file to your specific ones (replace and )
-
Visit the following url in your browser to generate the key:
-
After you get the key visit the following url in your browser to get the token:
-
https://trello.com/1/connect?key=&name=PostCommit&expiration=never&response_type=token&scope=read,write (replace the with your key)
- Modify the post-commit file's directory changes (cd) to point to where trello_commit.js is located
- Drop the post-commit file into any or all of your repo's .git/hooks folder
In order for your commit message to automatically be posted to a Trello card, you will have to know that card's id. The current trello_commit supports two types of ids, the boardId/shortId or the shortLink. Just open up the card in your browser and take a look at the url.
https://trello.com/card/name-of-card/5193b0b45b9811b7240036bf/68 So your commit would look like this:
git commit -m "My comment message | 5193b0b45b9811b7240036bf/68"
The second way to post a commit message to Trello is to get the shortLink of the card. You can do it by opening the card and finding the More.. link. Clicking the More... link will show a popup that will have a field called Link to this card and a shortened url. If you just copy that url you can do a commit with that link instead of the first method.
git commit -m "My comment message | https://trello.com/c/4Xdt2A6d" (Make sure to include the entire link)