Class: Atlassian::JiraConnect::Serializers::BuildEntity

Inherits:
Grape::Entity
  • Object
show all
Includes:
Gitlab::Routing
Defined in:
lib/atlassian/jira_connect/serializers/build_entity.rb

Overview

A Jira 'build' represents what we call a 'pipeline'

Instance Method Summary collapse

Methods included from Gitlab::Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Instance Method Details

#issue_keysObject


24
25
26
27
28
29
30
31
32
33
# File 'lib/atlassian/jira_connect/serializers/build_entity.rb', line 24

def issue_keys
  # extract Jira issue keys from either the source branch/ref or the
  # merge request title.
  @issue_keys ||= begin
    pipeline.all_merge_requests.flat_map do |mr|
      src = "#{mr.source_branch} #{mr.title} #{mr.description}"
      JiraIssueKeyExtractor.new(src).issue_keys
    end.uniq
  end
end