title: Using the Rally Rest API for CRUD operations
body: <p>At my company, we recently started using <a href="http://www.rallydev.com/" rel="nofollow">Rally</a> for our project management tool. Initially, someone external to our team invested a lot of time manually creating iterations using a naming convention that is just not going to jive with our team's existing scheme. Instead of asking this poor soul to delete these empty iterations by hand, one by one, I would like to automate this process using Rally's REST API. In short, we need to delete these 100+ empty iterations which span across 3 different projects (which all sharing a common parent).</p>
  
  <p>I have spent some time looking at the <a href="http://rally-rest-api.rubyforge.org/" rel="nofollow">rally-rest-api</a> ruby gem, and although I have some limited Ruby experience, the <strong>Query</strong> interface of the API remains confusing to me, and I am having some trouble wrapping my head around it. I know what my regex would like, but I just don't know how to supply that to the query.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>require 'rubygems'
  require 'rally_rest_api'
  
  rally = RallyRestAPI.new(:username =&gt; "myuser", 
                           :password =&gt; "mypass")
  regex = /ET-VT-100/    
  # get all names that match criteria
  iterations  = rally.find(:iteration) { "query using above regex?" }
  # delete all the matching iterations
  iterations.each do |iteration|
    iteration.delete    
  end
  </code></pre>
  
  <p>Any pointers in the right direction would be much appreciated. I feel like I'm almost there.</p>