Skip to content

Instantly share code, notes, and snippets.

@kei-s
Created November 5, 2014 07:22
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 kei-s/ef803493abc4c8c380c4 to your computer and use it in GitHub Desktop.
Save kei-s/ef803493abc4c8c380c4 to your computer and use it in GitHub Desktop.
require 'csv'
require 'pry'
require 'trello'
Trello.configure do |config|
config.developer_public_key = 'TRELLO_PUBLIC_KEY'
# Access https://trello.com/1/authorize?key=#{substitutewithyourapplicationkey}&name=My+Application&expiration=1day&response_type=token&scope=read,write
config.member_token = 'ACCESS_TOKEN'
end
backlog = Trello::Board.find('LIST_ID').lists.first
csv = CSV.read('IMPORTED_CSV_FROM_PIVOTAL', headers: true)
csv.each do |record|
next if record['Current State'] == 'accepted'
title = record['Title']
description = record['Description']
Trello::Card.create(
name: title,
desc: description,
list_id: backlog.id
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment