summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-11 07:16:32 -0700
committerStan Hu <stanhu@gmail.com>2016-06-11 19:50:08 -0700
commita85dde9182f177cc2fdabd90ccdad870bf4d84c3 (patch)
treeb1658e39b1ea6f4807c8e3cd275b39a9eee5f8f6 /lib/api/helpers.rb
parentff345f8ba11658c679b423e06bbc42b90af158eb (diff)
downloadgitlab-ce-a85dde9182f177cc2fdabd90ccdad870bf4d84c3.tar.gz
Fix Error 500 when using closes_issues API with an external issue tracker
Closes #18484
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index e1d3bbcc02d..de5959e3aae 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -418,5 +418,13 @@ module API
def send_git_archive(repository, ref:, format:)
header(*Gitlab::Workhorse.send_git_archive(repository, ref: ref, format: format))
end
+
+ def issue_entity(project)
+ if project.has_external_issue_tracker?
+ Entities::ExternalIssue
+ else
+ Entities::Issue
+ end
+ end
end
end