From e6ff6274414200cac26b29c0fb8f8e7fde7a556c Mon Sep 17 00:00:00 2001 From: Alejandro Mataloni Date: Fri, 29 May 2015 09:51:19 -0300 Subject: [PATCH] [#2] assign pivotal story if starting it. --- lib/assisted_workflow/addons/pivotal.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/assisted_workflow/addons/pivotal.rb b/lib/assisted_workflow/addons/pivotal.rb index 8c71df5..886d1e1 100644 --- a/lib/assisted_workflow/addons/pivotal.rb +++ b/lib/assisted_workflow/addons/pivotal.rb @@ -43,6 +43,12 @@ def start_story(story, options = {}) log "starting story ##{story.id}" options.delete(:estimate) if options[:estimate].nil? update_story!(story, options.merge(:current_state => "started")) + + owner_ids = story.owner_ids + if owner_ids.empty? || !owner_ids.include?(@client.me.id) + log "assigning story ##{story.id}" + update_story!(story, :owner_ids => owner_ids.dup << @client.me.id) + end end def finish_story(story, options = {})