Class: Dev::Jira::Issue
- Defined in:
- lib/firespring_dev_commands/jira/issue.rb
Overview
Contains information and methods representing a Jira issue
Constant Summary collapse
- NON_STORY_TYPES =
Issue subtypes which do not map to a story type
['review', 'sub-task', 'code review sub-task', 'pre-deploy sub-task', 'deploy sub-task', 'devops sub-task'].freeze
Instance Attribute Summary collapse
-
#assignee ⇒ Object
Returns the value of attribute assignee.
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#points ⇒ Object
Returns the value of attribute points.
-
#project ⇒ Object
Returns the value of attribute project.
-
#resolved_date ⇒ Object
Returns the value of attribute resolved_date.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#calculate_points(data) ⇒ Object
Returns the value of the jira points field or 0 if the field is not found.
-
#initialize(data) ⇒ Issue
constructor
A new instance of Issue.
-
#to_s ⇒ Object
Converts the jira issue object to a string representation.
Constructor Details
#initialize(data) ⇒ Issue
Returns a new instance of Issue.
10 11 12 13 14 15 16 17 18 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 10 def initialize(data) @data = data @project = Jira::Project.new(data) @id = data.key @title = data.summary @points = calculate_points(data) @assignee = Jira::User.lookup(data.assignee&.accountId) @resolved_date = data.resolutiondate end |
Instance Attribute Details
#assignee ⇒ Object
Returns the value of attribute assignee.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def assignee @assignee end |
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def id @id end |
#points ⇒ Object
Returns the value of attribute points.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def points @points end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def project @project end |
#resolved_date ⇒ Object
Returns the value of attribute resolved_date.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def resolved_date @resolved_date end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 8 def title @title end |
Instance Method Details
#calculate_points(data) ⇒ Object
Returns the value of the jira points field or 0 if the field is not found
21 22 23 24 25 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 21 def calculate_points(data) return data.send(Dev::Jira.config.points_field_name).to_i if Dev::Jira.config.points_field_name && data.respond_to?(Dev::Jira.config.points_field_name) 0 end |
#to_s ⇒ Object
Converts the jira issue object to a string representation
28 29 30 |
# File 'lib/firespring_dev_commands/jira/issue.rb', line 28 def to_s "[#{id}] #{title} (#{points} pts) (resolved #{resolved_date}" end |