Class: Gitlab::IncidentManagement::PagerDuty::IncidentIssueDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/incident_management/pager_duty/incident_issue_description.rb

Instance Method Summary collapse

Constructor Details

#initialize(incident_payload) ⇒ IncidentIssueDescription

Returns a new instance of IncidentIssueDescription.


7
8
9
# File 'lib/gitlab/incident_management/pager_duty/incident_issue_description.rb', line 7

def initialize(incident_payload)
  @incident_payload = incident_payload
end

Instance Method Details

#to_sObject


11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/incident_management/pager_duty/incident_issue_description.rb', line 11

def to_s
  markdown_line_break = "  \n"

  [
    "**Incident:** #{markdown_incident}",
    "**Incident number:** #{incident_payload['incident_number']}",
    "**Urgency:** #{incident_payload['urgency']}",
    "**Status:** #{incident_payload['status']}",
    "**Incident key:** #{incident_payload['incident_key']}",
    "**Created at:** #{markdown_incident_created_at}",
    "**Assignees:** #{markdown_assignees.join(', ')}",
    "**Impacted services:** #{markdown_impacted_services.join(', ')}"
  ].join(markdown_line_break)
end