Class: RedmineRemotes::Esosti::Entities::Issue
- Inherits:
-
Avmtrf1::Esosti::Entities::Issue
- Object
- Avmtrf1::Esosti::Entities::Issue
- RedmineRemotes::Esosti::Entities::Issue
- Defined in:
- lib/redmine_remotes/esosti/entities/issue.rb
Constant Summary collapse
- DEFAULT_TYPE_FOR_URL_PREFIX =
'_unmapped_'
- EXTRA_DESCRIPTION_BEFORE =
{ reported_by: 'Relatado por', affected_person: 'Pessoa afetada', type_description: 'Tipo de solicitação' }.freeze
- TYPES_FOR_URL =
{ 'INCIDENTE' => 'ms_incident', 'SS' => 'ms_sr' }.freeze
Instance Method Summary collapse
- #affected_person ⇒ Object
- #attributes ⇒ Object
- #author_login ⇒ Object
- #code ⇒ Object
- #created_on ⇒ Object
- #description ⇒ String
- #extra_description_before ⇒ Object
- #human_view_url ⇒ Object
- #related_mbos ⇒ Object
- #reported_by ⇒ Object
- #status_name ⇒ Object
- #subject ⇒ Object
- #type_class ⇒ Object
- #type_description ⇒ Object
- #type_for_url ⇒ Object
- #uid ⇒ Object
Instance Method Details
#affected_person ⇒ Object
25 26 27 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 25 def affected_person mail_local_part(attributes.fetch('AFFECTEDPERSON')) end |
#attributes ⇒ Object
29 30 31 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 29 def attributes data.first.fetch('Attributes') end |
#author_login ⇒ Object
21 22 23 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 21 def mail_local_part(attributes.fetch('CREATEDBY')) end |
#code ⇒ Object
33 34 35 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 33 def code attributes.fetch('TICKETID') end |
#created_on ⇒ Object
37 38 39 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 37 def created_on attributes.fetch('CREATIONDATE') end |
#description ⇒ String
42 43 44 45 46 47 48 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 42 def description ::RedmineRemotes::Esosti.remote_text_to_local( .if_key('LONGDESCRIPTION', '') do |v| v.first.fetch('Attributes').fetch('LDTEXT') end ) end |
#extra_description_before ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 50 def extra_description_before { 'Relatado por' => "user:#{reported_by}", 'Pessoa afetada' => "user:#{affected_person}", 'Tipo de solicitação' => type_description } end |
#human_view_url ⇒ Object
17 18 19 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 17 def human_view_url instance.issue_human_view_url(type_for_url, uid) end |
#related_mbos ⇒ Object
58 59 60 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 58 def data.first.fetch('RelatedMbos') end |
#reported_by ⇒ Object
62 63 64 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 62 def reported_by mail_local_part(attributes.fetch('REPORTEDBY')) end |
#status_name ⇒ Object
66 67 68 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 66 def status_name attributes.fetch('STATUS') end |
#subject ⇒ Object
70 71 72 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 70 def subject description.gsub(/\s+/, ' ') end |
#type_class ⇒ Object
78 79 80 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 78 def type_class attributes.fetch('CLASS') end |
#type_description ⇒ Object
82 83 84 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 82 def type_description attributes.fetch('DESCRIPTION') end |
#type_for_url ⇒ Object
74 75 76 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 74 def type_for_url TYPES_FOR_URL[type_class] || "#{DEFAULT_TYPE_FOR_URL_PREFIX}#{type_class}" end |
#uid ⇒ Object
86 87 88 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 86 def uid attributes.fetch('TICKETUID').fetch('content') end |