Created
February 8, 2013 12:56
-
-
Save cblunt/4738897 to your computer and use it in GitHub Desktop.
A simple Ruby script to bulk import a list of tickets into CodeBase (http://codebasehq.com). Depends on the codebase_api gem.
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 'rubygems' | |
# 1. Without Bundler | |
# $ gem install activesupport codebase_api | |
require 'active_support/core_ext/string' | |
require 'codebase_api' | |
# 2. With a Bundler Gemfile: | |
# # ./Gemfile | |
# gem 'codebase_api' | |
# gem 'active_support', :require => 'active_support/core_ext/string' | |
# | |
# $ bundle install | |
# require 'bundler' | |
# Bundler.require | |
CodebaseApi.account_user = "your_codebase_account_name/your_codebase_username" | |
CodebaseApi.api_key = "your_codebase_api_key" | |
tickets = [ | |
"Array of tickets", | |
"To be imported into", | |
"Your project" | |
# ... | |
] | |
tickets.each do |msg| | |
title = msg.truncate(100) # Just use the first 100 chars as the ticket title. | |
CodebaseApi::Ticket.create("your_project_permalink_name", title, msg) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment