Class: Apadmi::Grout::Issue
- Inherits:
-
Struct
- Object
- Struct
- Apadmi::Grout::Issue
- Defined in:
- lib/apadmi/grout/models/issue.rb
Overview
A generic issue type wrapping up the underlying JIRA & ADO object
Constant Summary collapse
- UNCLASSIFIED_ISSUE_TYPE =
Issue type string used for fallback issues created from commit messages when the ticket was not found in the board.
"Unclassified"
Instance Attribute Summary collapse
-
#issue_type ⇒ Object
Returns the value of attribute issue_type.
-
#key ⇒ Object
Returns the value of attribute key.
-
#raw_object ⇒ Object
Returns the value of attribute raw_object.
-
#status ⇒ Object
Returns the value of attribute status.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .from_ado_hash(hash) ⇒ Apadmi::Grout::Issue
- .from_ado_hashes(hashes) ⇒ Array<Apadmi::Grout::Issue>
- .from_jira_issue(issue, base_url) ⇒ Apadmi::Grout::Issue
- .from_jira_issues(issues, base_url) ⇒ Array<Apadmi::Grout::Issue>
-
.unclassified(key, summary) ⇒ Apadmi::Grout::Issue
Creates a fallback issue from a commit message when the ticket ID could not be found in the board.
Instance Attribute Details
#issue_type ⇒ Object
Returns the value of attribute issue_type
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def issue_type @issue_type end |
#key ⇒ Object
Returns the value of attribute key
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def key @key end |
#raw_object ⇒ Object
Returns the value of attribute raw_object
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def raw_object @raw_object end |
#status ⇒ Object
Returns the value of attribute status
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def status @status end |
#summary ⇒ Object
Returns the value of attribute summary
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url
13 14 15 |
# File 'lib/apadmi/grout/models/issue.rb', line 13 def url @url end |
Class Method Details
.from_ado_hash(hash) ⇒ Apadmi::Grout::Issue
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/apadmi/grout/models/issue.rb', line 23 def self.from_ado_hash(hash) Issue.new( hash["id"].to_s, hash["fields"]["System.Title"], hash["fields"]["System.State"], hash["fields"]["System.WorkItemType"], hash["url"], hash ) end |
.from_ado_hashes(hashes) ⇒ Array<Apadmi::Grout::Issue>
35 36 37 |
# File 'lib/apadmi/grout/models/issue.rb', line 35 def self.from_ado_hashes(hashes) hashes.map { |h| Issue.from_ado_hash(h) } end |
.from_jira_issue(issue, base_url) ⇒ Apadmi::Grout::Issue
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/apadmi/grout/models/issue.rb', line 41 def self.from_jira_issue(issue, base_url) Issue.new( issue.key, issue.summary, issue.status.name, issue.issuetype.name, "#{base_url}/browse/#{issue.key}", issue ) end |
.from_jira_issues(issues, base_url) ⇒ Array<Apadmi::Grout::Issue>
53 54 55 |
# File 'lib/apadmi/grout/models/issue.rb', line 53 def self.from_jira_issues(issues, base_url) issues.map { |i| Issue.from_jira_issue(i, base_url) } end |
.unclassified(key, summary) ⇒ Apadmi::Grout::Issue
Creates a fallback issue from a commit message when the ticket ID could not be found in the board.
18 19 20 |
# File 'lib/apadmi/grout/models/issue.rb', line 18 def self.unclassified(key, summary) Issue.new(key, summary, "Unknown", Issue::UNCLASSIFIED_ISSUE_TYPE, "", nil) end |