diff --git a/app/models/bug_tracking/jira_integration/jira.rb b/app/models/bug_tracking/jira_integration/jira.rb index 428bab6d..08ff2dd2 100644 --- a/app/models/bug_tracking/jira_integration/jira.rb +++ b/app/models/bug_tracking/jira_integration/jira.rb @@ -166,13 +166,35 @@ def bug_post_url(project, opts={}) se = StepExecution.find(opts[:step_execution_id]) bp = BugProduct.find_by_name(opts[:product]) name = se.case_execution.test_case.name - comment = "[Tarantula] Case \"#{name}\", Step #{se.position}" + stepId = se.step_id + summary = "[Tarantula] Case \"#{name}\", Step #{se.position}" + + comment = "h3. Problem:\n #{se.comment} \n\nh3. Steps to reproduce:\n" + + tcase = se.case_execution.test_case + execution = se.case_execution.execution + v = TestObject.find(execution.test_object_id) + cnt = 1 + for item in tcase.steps + + if ( item.id < stepId ) + comment = "#{comment}\n# #{item.action}" # -> #{item.result}" + else if ( item.id == stepId ) + comment = "#{comment}\n# #{item.action} \n\nh3. Expected result:\n #{item.result} \n\n" + break + end end + + cnt = cnt + 1 + end + + environment = "Execution: #{v.name}\nHardware: #{v.hardware}\nVersion: #{v.esw}" url = self.base_url.chomp('/') url += "/secure/CreateIssueDetails!init.jspa?#{bp.external_id.to_s.to_query(:pid) if bp}" + - "&issuetype=1&#{comment.to_query(:description)}" + "&issuetype=1&#{summary.to_query(:summary)}&#{comment.to_query(:description)}&#{environment.to_query(:environment)}" end + def bug_label(bug) "[#{bug.url}] #{bug.summary}" end @@ -241,6 +263,7 @@ def sweep_moved_bugs sweepable.each do |eid| logger.info "Sweeping bug with external_id #{eid}.." + self.bugs.find_by_external_id(eid).destroy end end