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 ⇒ Object
- #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 ⇒ Object
41 42 43 44 45 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 41 def description ::RedmineRemotes::Esosti.remote_text_to_local( .fetch('LONGDESCRIPTION').first.fetch('Attributes').fetch('LDTEXT') ) end |
#extra_description_before ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 47 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
55 56 57 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 55 def data.first.fetch('RelatedMbos') end |
#reported_by ⇒ Object
59 60 61 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 59 def reported_by mail_local_part(attributes.fetch('REPORTEDBY')) end |
#status_name ⇒ Object
63 64 65 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 63 def status_name attributes.fetch('STATUS') end |
#subject ⇒ Object
67 68 69 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 67 def subject description.gsub(/\s+/, ' ') end |
#type_class ⇒ Object
75 76 77 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 75 def type_class attributes.fetch('CLASS') end |
#type_description ⇒ Object
79 80 81 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 79 def type_description attributes.fetch('DESCRIPTION') end |
#type_for_url ⇒ Object
71 72 73 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 71 def type_for_url TYPES_FOR_URL[type_class] || "#{DEFAULT_TYPE_FOR_URL_PREFIX}#{type_class}" end |
#uid ⇒ Object
83 84 85 |
# File 'lib/redmine_remotes/esosti/entities/issue.rb', line 83 def uid attributes.fetch('TICKETUID').fetch('content') end |