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 21, 2018
1 parent e997b90 commit 7d91995
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/jira/resource/remotelink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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] + "/issue/#{issue.key}/#{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] + "/issue/#{issue.id}/#{endpoint_name}"
response = client.get(path)
json = parse_json(response.body)
json['watchers'].map do |watcher|
Expand Down

0 comments on commit 7d91995

Please sign in to comment.