Skip to content

Instantly share code, notes, and snippets.

@rzane
Created May 22, 2019 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rzane/f503113006f7f0ad3783fc8416090dfc to your computer and use it in GitHub Desktop.
Save rzane/f503113006f7f0ad3783fc8416090dfc to your computer and use it in GitHub Desktop.
Migrate GitHub issues to Pivotal Tracker
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