Skip to content

Commit

Permalink
Fix API path definitions
Browse files Browse the repository at this point in the history
Fixes sumoheavy#291

Declares `path` for API GET calls using not `issue.self` (which produces full URIs) but `client.options[:rest_base_path]`

Resulting API calls will not have repeated URIs which are raising `request_client.rb:16:in `request': JIRA::HTTPError`

Works For Me (TM)
  • Loading branch information
kali-brandwatch committed Jun 20, 2018
1 parent e997b90 commit ebdaa6b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/jira/resource/remotelink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def self.all(client, options = {})
end

path = "#{issue.self}/#{endpoint_name}"
path = client.options[:rest_base_path] + "/#{endpoint_name}"
response = client.get(path)
json = parse_json(response.body)
json.map do |link|
Expand Down
2 changes: 1 addition & 1 deletion lib/jira/resource/transition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.all(client, options = {})
raise ArgumentError.new("parent issue is required")
end

path = "#{issue.self}/#{endpoint_name}?expand=transitions.fields"
path = client.options[:rest_base_path] + "/issue/#{issue.key}/#{endpoint_name}?expand=transitions.fields"
response = client.get(path)
json = parse_json(response.body)
json['transitions'].map do |transition|
Expand Down
2 changes: 1 addition & 1 deletion lib/jira/resource/watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.all(client, options = {})
raise ArgumentError.new("parent issue is required")
end

path = "#{issue.self}/#{endpoint_name}"
path = client.options[:rest_base_path] + "/#{endpoint_name}"
response = client.get(path)
json = parse_json(response.body)
json['watchers'].map do |watcher|
Expand Down

0 comments on commit ebdaa6b

Please sign in to comment.