Class: JiraServer::V3

Inherits:
Integration
  • Object
show all
Defined in:
app/models/pager_tree/integrations/jira_server/v3.rb

Constant Summary collapse

OPTIONS =
[
  {key: :issue_updated, type: :boolean, default: false}
]

Instance Method Summary collapse

Instance Method Details

#adapter_actionObject



30
31
32
33
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 30

def adapter_action
  event = adapter_incoming_request_params.dig("webhookEvent")
  event == "jira:issue_created" || (self.option_issue_updated == true && event == "jira:issue_updated") ? :create : :other
end

#adapter_incoming_can_defer?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 22

def adapter_incoming_can_defer?
  true
end

#adapter_process_createObject



35
36
37
38
39
40
41
42
43
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 35

def adapter_process_create
  Alert.new(
    title: _title,
    description: _description,
    thirdparty_id: adapter_thirdparty_id,
    dedup_keys: [],
    additional_data: _additional_datums
  )
end

#adapter_supports_incoming?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 14

def adapter_supports_incoming?
  true
end

#adapter_supports_outgoing?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 18

def adapter_supports_outgoing?
  false
end

#adapter_thirdparty_idObject



26
27
28
# File 'app/models/pager_tree/integrations/jira_server/v3.rb', line 26

def adapter_thirdparty_id
  adapter_incoming_request_params.dig("issue", "id")
end