Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions app/models/bug_tracking/jira_integration/jira.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down