Class: Avmtrf1::Jira::Instance

Inherits:
RestProvider::Instance show all
Defined in:
lib/avmtrf1/jira/instance.rb

Constant Summary collapse

ISSUE_ID_PATTERN =
/\A([a-z][a-z0-9]+)\-(\d+)\z/i.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RestProvider::Instance

#request, #request_json

Class Method Details

.parse_issue_id(global_issue_id) ⇒ Object


11
12
13
14
15
16
# File 'lib/avmtrf1/jira/instance.rb', line 11

def parse_issue_id(global_issue_id)
  m = ISSUE_ID_PATTERN.match(global_issue_id)
  return nil unless m

  ::OpenStruct.new(provider_issue_id: m[0], project_id: m[1], project_issue_id: m[2])
end

Instance Method Details

#build_service_url(service_url_suffix) ⇒ Object


19
20
21
# File 'lib/avmtrf1/jira/instance.rb', line 19

def build_service_url(service_url_suffix)
  "#{root_url}/rest/api/latest#{service_url_suffix}"
end

#issue_get_url_suffix(provider_issue_id) ⇒ Object


23
24
25
# File 'lib/avmtrf1/jira/instance.rb', line 23

def issue_get_url_suffix(provider_issue_id)
  "/issue/#{provider_issue_id}"
end