lib/pivotal-tracker/story.rb in pivotal-tracker-0.2.2 vs lib/pivotal-tracker/story.rb in pivotal-tracker-0.3.0
- old
+ new
@@ -7,9 +7,19 @@
params = PivotalTracker.encode_options(options)
stories = parse(Client.connection["/projects/#{project.id}/stories#{params}"].get)
stories.each { |s| s.project_id = project.id }
return stories
end
+
+ def find(param, project_id)
+ begin
+ story = parse(Client.connection["/projects/#{project_id}/stories/#{param}"].get)
+ story.project_id = project_id
+ rescue RestClient::ExceptionWithResponse
+ story = nil
+ end
+ return story
+ end
end
tag "story"
element :id, Integer