Class: Freshservice::V3
- Inherits:
-
Integration
- Object
- Integration
- Freshservice::V3
- Defined in:
- app/models/pager_tree/integrations/freshservice/v3.rb
Constant Summary collapse
- FS_TICKET_STATUS =
{ open: 2, pending: 3, resolved: 4, closed: 5 }
- FS_TICKET_PRIORITY =
{ low: 1, medium: 2, high: 3, urgent: 4 }
- OPTIONS =
[]
Instance Method Summary collapse
- #adapter_action ⇒ Object
- #adapter_incoming_can_defer? ⇒ Boolean
- #adapter_process_create ⇒ Object
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_supports_outgoing? ⇒ Boolean
- #adapter_thirdparty_id ⇒ Object
Instance Method Details
#adapter_action ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 39 def adapter_action status = _freshservice_webhook.dig("ticket_status") status_i = status&.to_i if status_i == FS_TICKET_STATUS[:open] || status == "Open" || status_i == FS_TICKET_STATUS[:pending] || status == "Pending" :create elsif status_i == FS_TICKET_STATUS[:resolved] || status == "Resolved" || status_i == FS_TICKET_STATUS[:closed] || status == "Closed" :resolve else :other end end |
#adapter_incoming_can_defer? ⇒ Boolean
31 32 33 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 31 def adapter_incoming_can_defer? true end |
#adapter_process_create ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 52 def adapter_process_create Alert.new( title: _title, description: _description, urgency: _urgency, thirdparty_id: adapter_thirdparty_id, dedup_keys: [], additional_data: _additional_datums ) end |
#adapter_supports_incoming? ⇒ Boolean
23 24 25 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 23 def adapter_supports_incoming? true end |
#adapter_supports_outgoing? ⇒ Boolean
27 28 29 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 27 def adapter_supports_outgoing? false end |
#adapter_thirdparty_id ⇒ Object
35 36 37 |
# File 'app/models/pager_tree/integrations/freshservice/v3.rb', line 35 def adapter_thirdparty_id _freshservice_webhook.dig("ticket_public_url") end |