Class: Communication::API

Inherits:
Object
  • Object
show all
Defined in:
lib/communication/api.rb

Overview

Defines API calls

Class Method Summary collapse

Class Method Details

.get_issue(issue_id) ⇒ WorklogIssue

Fetch an issue from JIRA Server.

Returns:

  • (WorklogIssue)

    User info.



27
28
29
30
31
32
# File 'lib/communication/api.rb', line 27

def self.get_issue(issue_id)
  Communicator.instance.get("#{Communicator.base_api_url}/issue/#{issue_id}") do |body, _|
    issue = WorklogIssue.new(jira_id: body[:key], description: body[:fields][:summary])
    yield(issue) if block_given?
  end
end