summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2015-12-17 16:08:14 -0600
committerDrew Blessing <drew@gitlab.com>2015-12-18 14:19:48 -0600
commitf177aaa5fa789654dc440d6ec4ae3546544c1401 (patch)
tree709b259ea7903da9ac28e5393cc29d0780a6c63a /app/services
parent27859f7ed9e1efe98b8386844d0a7e69fd58277a (diff)
downloadgitlab-ce-f177aaa5fa789654dc440d6ec4ae3546544c1401.tar.gz
Backport JIRA service
Diffstat (limited to 'app/services')
-rw-r--r--app/services/issues/close_service.rb5
-rw-r--r--app/services/system_note_service.rb9
2 files changed, 12 insertions, 2 deletions
diff --git a/app/services/issues/close_service.rb b/app/services/issues/close_service.rb
index 3d85f97b7e5..a1a20e47681 100644
--- a/app/services/issues/close_service.rb
+++ b/app/services/issues/close_service.rb
@@ -1,6 +1,11 @@
module Issues
class CloseService < Issues::BaseService
def execute(issue, commit = nil)
+ if project.jira_tracker? && project.jira_service.active
+ project.jira_service.execute(commit, issue)
+ return issue
+ end
+
if project.default_issues_tracker? && issue.close
event_service.close_issue(issue, current_user)
create_note(issue, commit)
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 6975b2ee55b..98a71cbf1ad 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -241,9 +241,14 @@ class SystemNoteService
note_options.merge!(noteable: noteable)
end
- create_note(note_options)
+ if noteable.is_a?(ExternalIssue)
+ noteable.project.issues_tracker.create_cross_reference_note(noteable, mentioner, author)
+ else
+ create_note(note_options)
+ end
end
+
def self.cross_reference?(note_text)
note_text.start_with?(cross_reference_note_prefix)
end
@@ -259,7 +264,7 @@ class SystemNoteService
#
# Returns Boolean
def self.cross_reference_disallowed?(noteable, mentioner)
- return true if noteable.is_a?(ExternalIssue)
+ return true if noteable.is_a?(ExternalIssue) && !noteable.project.jira_tracker_active?
return false unless mentioner.is_a?(MergeRequest)
return false unless noteable.is_a?(Commit)