Created
June 11, 2012 17:17
-
-
Save comeara/2911403 to your computer and use it in GitHub Desktop.
Bulk Load AgileZen Stories
This file contains hidden or 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 "rest_client" | |
require "pry" | |
project_id = "99999" | |
api_key = "00000000000000000000000000000000" | |
url = ("https://agilezen.com/api/v1/projects/%s/stories" % project_id) | |
logger = Logger.new($stdout) | |
headers = { | |
"X-Zen-ApiKey" => api_key, | |
"Accept" => "text/json" | |
} | |
CSV.foreach("stories.csv", headers: :first_row, return_headers: false) do |story| | |
payload = { | |
text: story["Story"], | |
color: "green", | |
size: story["Points"], | |
tags: [ "feature" ] | |
}.to_json | |
begin | |
response = RestClient.post(url, payload, headers) | |
logger.info "Created: #{story["Story"]}" | |
rescue => e | |
pry binding | |
logger.error "Failed: #{story["Story"]}" | |
end | |
end |
This file contains hidden or 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
source :rubygems | |
gem "json_pure" | |
gem "rest-client" | |
gem "pry" |
This file contains hidden or 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
Story | T-Shirt Size | Points | Category | Priority | |
---|---|---|---|---|---|
As a developer, I can bulk load stories into AgileZen. | S | 1 | Project Admin | 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment