Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an optional tracker_id field #1

Merged
merged 1 commit into from
Dec 7, 2014
Merged
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
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