diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/models/project_services/jira_service.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/models/project_services/jira_service.rb')
-rw-r--r-- | app/models/project_services/jira_service.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb index 1f4abfc1aca..dafd3d095ec 100644 --- a/app/models/project_services/jira_service.rb +++ b/app/models/project_services/jira_service.rb @@ -157,8 +157,12 @@ class JiraService < IssueTrackerService # support any events. end + def find_issue(issue_key) + jira_request { client.Issue.find(issue_key) } + end + def close_issue(entity, external_issue) - issue = jira_request { client.Issue.find(external_issue.iid) } + issue = find_issue(external_issue.iid) return if issue.nil? || has_resolution?(issue) || !jira_issue_transition_id.present? @@ -172,7 +176,7 @@ class JiraService < IssueTrackerService # Depending on the Jira project's workflow, a comment during transition # may or may not be allowed. Refresh the issue after transition and check # if it is closed, so we don't have one comment for every commit. - issue = jira_request { client.Issue.find(issue.key) } if transition_issue(issue) + issue = find_issue(issue.key) if transition_issue(issue) add_issue_solved_comment(issue, commit_id, commit_url) if has_resolution?(issue) end @@ -181,7 +185,7 @@ class JiraService < IssueTrackerService return s_("JiraService|Events for %{noteable_model_name} are disabled.") % { noteable_model_name: noteable.model_name.plural.humanize(capitalize: false) } end - jira_issue = jira_request { client.Issue.find(mentioned.id) } + jira_issue = find_issue(mentioned.id) return unless jira_issue.present? |