Commit 68ee87135d58ab6ef05ac5c2c80c582c72c2f9dd

Authored by Nathan Broadbent
1 parent d8aa60d8
Exists in master and in 1 other branch production

Make reported_by an optional argument for issue trackers #create_issue method

app/models/issue_trackers/fogbugz_tracker.rb
@@ -22,7 +22,7 @@ class IssueTrackers::FogbugzTracker < IssueTracker @@ -22,7 +22,7 @@ class IssueTrackers::FogbugzTracker < IssueTracker
22 end 22 end
23 end 23 end
24 24
25 - def create_issue(problem, reported_by) 25 + def create_issue(problem, reported_by = nil = nil)
26 fogbugz = Fogbugz::Interface.new(:email => username, :password => password, :uri => "https://#{account}.fogbugz.com") 26 fogbugz = Fogbugz::Interface.new(:email => username, :password => password, :uri => "https://#{account}.fogbugz.com")
27 fogbugz.authenticate 27 fogbugz.authenticate
28 28
app/models/issue_trackers/github_issues_tracker.rb
@@ -19,7 +19,7 @@ class IssueTrackers::GithubIssuesTracker < IssueTracker @@ -19,7 +19,7 @@ class IssueTrackers::GithubIssuesTracker < IssueTracker
19 end 19 end
20 end 20 end
21 21
22 - def create_issue(problem, reported_by) 22 + def create_issue(problem, reported_by = nil)
23 client = Octokit::Client.new(:login => username, :token => api_token) 23 client = Octokit::Client.new(:login => username, :token => api_token)
24 issue = client.create_issue(project_id, issue_title(problem), body_template.result(binding).unpack('C*').pack('U*'), options = {}) 24 issue = client.create_issue(project_id, issue_title(problem), body_template.result(binding).unpack('C*').pack('U*'), options = {})
25 problem.update_attribute :issue_link, issue.html_url 25 problem.update_attribute :issue_link, issue.html_url
app/models/issue_trackers/lighthouse_tracker.rb
@@ -18,7 +18,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker @@ -18,7 +18,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker
18 end 18 end
19 end 19 end
20 20
21 - def create_issue(problem, reported_by) 21 + def create_issue(problem, reported_by = nil)
22 Lighthouse.account = account 22 Lighthouse.account = account
23 Lighthouse.token = api_token 23 Lighthouse.token = api_token
24 # updating lighthouse account 24 # updating lighthouse account
app/models/issue_trackers/mingle_tracker.rb
@@ -27,7 +27,7 @@ class IssueTrackers::MingleTracker < IssueTracker @@ -27,7 +27,7 @@ class IssueTrackers::MingleTracker < IssueTracker
27 end 27 end
28 end 28 end
29 29
30 - def create_issue(problem, reported_by) 30 + def create_issue(problem, reported_by = nil)
31 properties = ticket_properties_hash 31 properties = ticket_properties_hash
32 basic_auth = account.gsub(/https?:\/\//, "https://#{username}:#{password}@") 32 basic_auth = account.gsub(/https?:\/\//, "https://#{username}:#{password}@")
33 Mingle.set_site "#{basic_auth}/api/v1/projects/#{project_id}/" 33 Mingle.set_site "#{basic_auth}/api/v1/projects/#{project_id}/"
app/models/issue_trackers/pivotal_labs_tracker.rb
@@ -13,7 +13,7 @@ class IssueTrackers::PivotalLabsTracker < IssueTracker @@ -13,7 +13,7 @@ class IssueTrackers::PivotalLabsTracker < IssueTracker
13 end 13 end
14 end 14 end
15 15
16 - def create_issue(problem, reported_by) 16 + def create_issue(problem, reported_by = nil)
17 PivotalTracker::Client.token = api_token 17 PivotalTracker::Client.token = api_token
18 PivotalTracker::Client.use_ssl = true 18 PivotalTracker::Client.use_ssl = true
19 project = PivotalTracker::Project.find project_id.to_i 19 project = PivotalTracker::Project.find project_id.to_i
app/models/issue_trackers/redmine_tracker.rb
@@ -25,7 +25,7 @@ class IssueTrackers::RedmineTracker < IssueTracker @@ -25,7 +25,7 @@ class IssueTrackers::RedmineTracker < IssueTracker
25 end 25 end
26 end 26 end
27 27
28 - def create_issue(problem, reported_by) 28 + def create_issue(problem, reported_by = nil)
29 token = api_token 29 token = api_token
30 acc = account 30 acc = account
31 RedmineClient::Base.configure do 31 RedmineClient::Base.configure do