Skip to content

Commit

Permalink
Merge pull request #1 from brodock/tracker_id
Browse files Browse the repository at this point in the history
Added an optional tracker_id field
  • Loading branch information
stevecrozz committed Dec 7, 2014
2 parents f84ed2f + 84a04a3 commit 66c169e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/errbit_redmine_plugin/issue_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class IssueTracker < ErrbitPlugin::IssueTracker
:optional => true,
:label => "App Project",
:placeholder => "Where app's files & revisions can be viewed. (Leave blank to use the above project by default)"
}],
[:tracker_id, {
:optional => true,
:label => "Issue Tracker Id",
:placeholder => "The tracker where tickets will be created. (Leave blank to use default)"
}]
]

Expand Down Expand Up @@ -82,6 +87,7 @@ def create_issue(problem, reported_by = nil)
user = params['username']
passwd = params['password']
project_id = params['project_id']
tracker_id = params['tracker_id']

RedmineClient::Base.configure do
self.token = token
Expand All @@ -94,6 +100,7 @@ def create_issue(problem, reported_by = nil)
issue = RedmineClient::Issue.new(:project_id => project_id)
issue.subject = "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}"
issue.description = self.class.body_template.result(binding)
issue.tracker_id = tracker_id if tracker_id.present?
issue.save!

problem.update_attributes(
Expand Down

0 comments on commit 66c169e

Please sign in to comment.