<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I want to be free &#187; assembla</title>
	<atom:link href="http://i1t2b3.com/category/assembla/feed/" rel="self" type="application/rss+xml" />
	<link>http://i1t2b3.com</link>
	<description>Any fool can make things bigger and more complex</description>
	<lastBuildDate>Wed, 28 Jul 2010 14:34:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3703</generator>
		<item>
		<title>How to import tickets into Assembla</title>
		<link>http://i1t2b3.com/2009/08/26/how-to-import-tickets-assembla/</link>
		<comments>http://i1t2b3.com/2009/08/26/how-to-import-tickets-assembla/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 10:07:31 +0000</pubDate>
		<dc:creator>Skakunov Alexander</dc:creator>
				<category><![CDATA[api]]></category>
		<category><![CDATA[assembla]]></category>
		<category><![CDATA[ideas]]></category>

		<guid isPermaLink="false">http://i1t2b3.com/?p=481</guid>
		<description><![CDATA[I use Assembla for my projects, and I found that export/import tickets feature works tricky — it works based on a combination of JSON and CSV format. It seems the guys in Assembla are on a way to proprietary formats The only usage of it is only for moving tickets from one Assembla space to [...]]]></description>
			<content:encoded><![CDATA[<p>I use Assembla for my projects, and I found that export/import tickets feature works tricky — it works based on a combination of JSON and CSV format. It seems the guys in Assembla are on a way to proprietary formats <img src='http://i1t2b3.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  The only usage of it is only for moving tickets from one Assembla space to another.</p>
<p>So this post is about how to use what they offer to add lots of tickets that you have listed in your text file. I am lazy — instead of adding 90+ tickets manually, I&#8217;d better create a tool to do it for me.</p>
<h3>Task</h3>
<p>You have tickets titles and descriptions as text, and you want to add these tickets to Assembla.</p>
<h3>My solution</h3>
<p>Let&#8217;s investigate what format should our data be of so that Assembla could digest it. Go to a space → <em>Tickets</em>  → <em>Settings</em>  → scroll down and find <em>Export &amp; Import</em> → click &#8220;<em>Export your tickets</em>&#8221; links and open the dump file in a text editor. Though it&#8217;s indicated that &#8220;<em>Tickets imported and exported in JSON format.</em>&#8220;, it&#8217;s not. It&#8217;s a mix.</p>
<p>The dump file contains blocks that represent spaces, milestones, tickets, comments, custom fields values and tickets associations. Every such block contains 2 parts: list of fields and bigger part — actual data of this fields.</p>
<p>What we need is tickets part.</p>
<p>This is a format definition part:</p>
<pre><code>tickets:fields, ["id","number","reporter_id","assigned_to_id","space_id","summary","priority","status","description","created_on","updated_at","milestone_id","component_id","notification_list","completed_date","working_hours","is_story","from_support"]</code></pre>
<p>And this is an example of ticket data:</p>
<pre><code>tickets, ["40999","1","dNltOqvXKr3RN3e","FoGbar3zTtab7rAJ","b3OWYeJe5aVNr","Property owner profile - create new","3","3","","2009-06-16 07:23:35","2009-07-05 10:43:58","94111","12",null,"2009-07-05 10:43:58",null,"0","0"]</code></pre>
<p>So, <strong>the solution is to create a list of tickets data by the format given</strong>. Here is how I did that.</p>
<p>1. I have Excel spreadsheet with two columns — the ticket title and description.</p>
<p>2. Export it as CSV, and open it having it like this:</p>
<pre><code class="no-highlight">Home page: Update design,Set numbers after locations
Photos: hide step 2,Show only Step 1 until you select files and then show step 2 to upload files.</code></pre>
<p>3. Use text replace to put every value in quotes (hint: use a line ending symbol as a replacement &mdash; even Microsoft Word can do that)</p>
<pre><code class="no-highlight">"Home page: Update design","Set numbers after locations"
"Photos upload: hide step 2","Show Step 2 only if files are selected."</code></pre>
<p>(One way round is to load the CSV data into database by PHPMyAdmin and export it back as CSV &mdash; it will be quoted <img src='http://i1t2b3.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>4. Add Assembla header to the top of this file</p>
<p>5. Move &#8216;<em>summary</em>&#8216; and &#8216;<em>description</em>&#8216; columns go first, so it was</p>
<pre><code class="javascript">tickets:fields, ["id","number","reporter_id","assigned_to_id","space_id","<strong>summary</strong>","priority",...</code></pre>
<p>and it becomes</p>
<pre><code class="javascript">tickets:fields, ["<strong>summary</strong>","<strong>description</strong>","id","number","reporter_id","assigned_to_id","space_id","priority",...</code></pre>
<p> (We need all the columns because it seems that Assembla's import engine is not smart enough to deal with missing fields).</p>
<p>6. Edit our tickets data lines (text replace again) so that it looked like Assembla tickets data, i.e. add '<em>tickets, [</em>' at the beginning, dummy values for the rest of the fields and the closing square bracket. <strong>Don't forget that we moved '<em>summary</em>' and '<em>description</em>' columns to go first!</strong>. So we have:</p>
<pre><code class="javascript">tickets, ["Home page: Update design","Set numbers after locations","40999","1","dNltOqvXKr3RN3e","FoGbar3zTtab7rAJ","b3OWYeJe5aVNr","3","3","2009-06-16 07:23:35","2009-07-05 10:43:58","94111","12",null,"2009-07-05 10:43:58",null,"0","0"]
tickets, ["Photos upload: hide step 2","Show Step 2 only if files are selected.","40999","1","dNltOqvXKr3RN3e","FoGbar3zTtab7rAJ","b3OWYeJe5aVNr","3","3","2009-06-16 07:23:35","2009-07-05 10:43:58","94111","12",null,"2009-07-05 10:43:58",null,"0","0"]</code></pre>
<p>By the way, I prefer to clear the values of some columns like &#8216;<em>id</em>&#8216;, &#8216;<em>number</em>&#8216; (ticket number) and so on &mdash; so that Assembla assigned it itself.</p>
<p>OK, it seems your file is ready to be fed to Assembla. I advise you to create an empty free space and try on it first if don&#8217;t want to mess up your current space.</p>
<p>If the import engine has some parsing problems with your file (missing quote for example) you will get a notice. If you get an Application Error, some columns or their values are missing &mdash; check your file.</p>
<p>One more tip &mdash; your tickets will be added as &#8216;<em>No milestone</em>&#8216;. If you want your new tickets to be added into a new milestone, paste a milestone defenition in the beginning of your file and replace milestone ID in the tickets data by it&#8217;s ID:</p>
<pre><code class="javascript">milestones:fields, ["id","due_date","title","user_id","created_at","created_by","space_id","description","is_completed","completed_date","from_basecamp","basecamp_milestone_id","updated_at","updated_by"]
milestones, ["1111","2009-09-09","Big shot of development","cv2gFo","2009-08-25 13:12:09","cv2gFo","bktPVqwKmr3OWYeJe5aVNr","Work hard to finish all that was discussed.","0",null,"0",null,"2009-08-25 13:12:09","cv2gFo"]</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://i1t2b3.com/2009/08/26/how-to-import-tickets-assembla/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
