Created
May 22, 2019 15:57
-
-
Save rzane/f503113006f7f0ad3783fc8416090dfc to your computer and use it in GitHub Desktop.
Migrate GitHub issues to Pivotal Tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'github_api' | |
require 'tracker_api' | |
GITHUB_USER = 'username or organization' | |
GITHUB_REPO = 'repo' | |
GITHUB_LOGIN = 'username' | |
GITHUB_PASSWORD = '***' | |
PIVOTAL_TOKEN = '***' | |
PIVOTAL_PROJECT_ID = 'last segment of the pivotal URL' | |
github = Github.new(login: GITHUB_LOGIN, password: GITHUB_PASSWORD) | |
issues = github.issues.list(user: GITHUB_USER, repo: GITHUB_REPO) | |
pivotal = TrackerApi::Client.new(token: PIVOTAL_TOKEN) | |
project = pivotal.project(PIVOTAL_PROJECT_ID) | |
issues.each do |issue| | |
puts format("\e[1m==> %s\e[22m\n%s\n\n", issue.title, issue.body) | |
project.create_story(name: issue.title, description: issue.body) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment