Skip to content

Commit 7d91995

Browse files
Fix API path definitions
Fixes #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)
1 parent e997b90 commit 7d91995

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/jira/resource/remotelink.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.all(client, options = {})
1717
raise ArgumentError.new("parent issue is required")
1818
end
1919

20-
path = "#{issue.self}/#{endpoint_name}"
20+
path = client.options[:rest_base_path] + "/issue/#{issue.key}/#{endpoint_name}"
2121
response = client.get(path)
2222
json = parse_json(response.body)
2323
json.map do |link|

lib/jira/resource/transition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def self.all(client, options = {})
2020
raise ArgumentError.new("parent issue is required")
2121
end
2222

23-
path = "#{issue.self}/#{endpoint_name}?expand=transitions.fields"
23+
path = client.options[:rest_base_path] + "/issue/#{issue.key}/#{endpoint_name}?expand=transitions.fields"
2424
response = client.get(path)
2525
json = parse_json(response.body)
2626
json['transitions'].map do |transition|

lib/jira/resource/watcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def self.all(client, options = {})
1919
raise ArgumentError.new("parent issue is required")
2020
end
2121

22-
path = "#{issue.self}/#{endpoint_name}"
22+
path = client.options[:rest_base_path] + "/issue/#{issue.id}/#{endpoint_name}"
2323
response = client.get(path)
2424
json = parse_json(response.body)
2525
json['watchers'].map do |watcher|

0 commit comments

Comments
 (0)