Class: Gitlab::JiraImport::MetadataCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/jira_import/metadata_collector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jira_issue) ⇒ MetadataCollector

Returns a new instance of MetadataCollector.


8
9
10
11
# File 'lib/gitlab/jira_import/metadata_collector.rb', line 8

def initialize(jira_issue)
  @jira_issue = jira_issue
  @metadata = []
end

Instance Attribute Details

#jira_issueObject

Returns the value of attribute jira_issue


6
7
8
# File 'lib/gitlab/jira_import/metadata_collector.rb', line 6

def jira_issue
  @jira_issue
end

#metadataObject

Returns the value of attribute metadata


6
7
8
# File 'lib/gitlab/jira_import/metadata_collector.rb', line 6

def 
  @metadata
end

Instance Method Details

#executeObject


13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/jira_import/metadata_collector.rb', line 13

def execute
  add_field(%w(issuetype name), 'Issue type')
  add_field(%w(priority name), 'Priority')
  add_field('environment', 'Environment')
  add_field('duedate', 'Due date')
  add_parent
  add_versions

  return if .empty?

  .join("\n").prepend("\n\n---\n\n**Issue metadata**\n\n")
end