How can I use curl/ruby to retrieve exported csv file?
Can someone help me understand how to specify my Tracker user/passwd on a curl command when retrieving the csv export of my project? I just need an example that works.
I'm using ruby to read the csv. I'd be just as happy with a pure ruby example that retrieved the csv export from pivotaltracker.com.
I'm using ruby to read the csv. I'd be just as happy with a pure ruby example that retrieved the csv export from pivotaltracker.com.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?We currently do not have a way to programatically retrieve data from Tracker. We are working on XML/JSON Tracker API that will enable users to programatically interact/retrieve data from Tracker. The new API should be deployed in the next few weeks.
Would want the new API to include a csv export option as well?
Mark -
Well, xml is ok so long as I can read it without heroics. I'm programming in Quartz Composer (good for visualizations) and its XML support is modest. If you can give me early access, I will give my tools a test and even share the visualization that results.
Details: Composer abstracts XML into a black box that takes a url in and answers a structure out. A composer structure is like a ruby hash of hashes. The problem is that this built-in translation is lossy. If you use every XML capability I will probably have to write an XML simplifier as a separate process, complicating the install beyond my energy for other than my own use.
I'm using a separate process to translate CSV to XML now. Here is the ruby that does the translation:
require 'csv'
reader = CSV.open('tracker.csv', 'r')
keys = reader.shift.collect {|key| key.gsub(/ /, '_').downcase}
puts '<file>'
reader.each do |row|
i = 0
puts ' <row>'
row.each do |value|
key = keys[i]
i += 1
puts " <#{key}>#{value}</#{key}>" if value && value != ''
end
puts ' </row>'
end
puts '</file>'
-
Inappropriate?Once we are ready, we can definitely give early access to our staging environment. Below is an example or our current XML format for story retrieval
<response>
<stories>
<story>
<id type="integer">2914</id>
<story_type>feature</story_type>
<url>http://demo.pivotaltracker.com/story/...</url>
<estimate type="integer">2</estimate>
<current_state>accepted</current_state>
<description></description>
<name>Any user can initiate a Search by product name, color, product type, size, size variant, and style ID </name>
<requested_by>Michael Test</requested_by>
<owned_by>Steve Test</owned_by>
<created_at>Oct 17, 2006</created_at>
<accepted_at>Oct 2, 2006</accepted_at>
</story>
</stories>
</response> -
Mark -- This is very close to what my ruby code produces from the existing csv. Some questions: What is name? Why is description empty? What happened to the notes? -
Inappropriate?The name is the story title that is displayed as part of the unexpanded view of a story. The description is the text placed in the "Description" section of an expanded story.
The example story I used just happened to not have any notes. Notes will show up under the story element like this:
<story>
....
<notes>
<note>
<text>a note</text>
<author>Mark Test</author>
<date>Oct 28, 2008</date>
</note>
</notes>
</story>
Mark -
Perfect.
I will assume that you have an equally good solution for authenticating my request. That was the one thing that prevented me from using the CSV export you already have. -
Inappropriate?Our current plan is to use a token based authentication approach. Each user will be able to generate a token that will be passed along as the basic auth user during api requests. More to come on this in the future.
1 person says
this answers the question
Loading Profile...


