Skip to content

Instantly share code, notes, and snippets.

@steinbrueckri
Created March 9, 2020 21:01
Show Gist options
  • Save steinbrueckri/f4df4e13f5c9b33bdbdc4607739c2d04 to your computer and use it in GitHub Desktop.
Save steinbrueckri/f4df4e13f5c9b33bdbdc4607739c2d04 to your computer and use it in GitHub Desktop.
Dirty Trello2Github issues migration script
#!/bin/bash
### Open your Trello Board in the Brower for example https://trello.com/b/UyF8VyFV/innovation-weekly
### Add ".json" add the end of the URL like https://trello.com/b/UyF8VyFV/innovation-weekly.json
### Now your browser should display a Json Doc, download this.
for row in $(cat innovation-weekly.json | jq -r '.cards[] | { status: .closed, name: .name, desc: .desc} | @base64'); do
_jq() {
echo ${row} | base64 --decode | jq -r ${1} | tr -d '\n'
}
if [ "$(_jq '.status')" != "false" ]; then
echo "$(_jq '.name') - $(_jq '.desc')"
gh issue create -R username/repo -t "$(_jq '.name')" -b "body: $(_jq '.desc')"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment