-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transition class HTTPError on reading API response #291
Comments
kali-hernandez
pushed a commit
to kali-hernandez/jira-ruby
that referenced
this issue
Jun 20, 2018
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)
Added a PR with a possible solution |
kali-hernandez
pushed a commit
to kali-hernandez/jira-ruby
that referenced
this issue
Jun 20, 2018
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)
kali-hernandez
pushed a commit
to kali-hernandez/jira-ruby
that referenced
this issue
Jun 21, 2018
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)
kali-hernandez
added a commit
to kali-hernandez/jira-ruby
that referenced
this issue
Jul 4, 2018
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the
Transition
class I get an http error while trying to fetch the json from API:I added some debugging to the
request_client.rb
and managed to find out a sensible difference in between successful requests:and the unsuccessful one:
I suspect the
get
call underdef request()
in:https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/client.rb#L226-L229
is erroneously getting the full url rather than the path it expects (e.g. starting from the rest path)
Upon further investigation I found that the
Transition
class definition inhttps://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/transition.rb#L23
uses
#{issue.self}
to build the path, whereas most other classes (see:https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/issue.rb#L94 or
https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/attachment.rb#L19 or
https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/user.rb#L7
just to name a few) use
#{client.options[:rest_base_path]}
instead.I have seen at least other 2 places where the url is built with
#{issue.self}
(https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/watcher.rb#L22 and
https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/resource/remotelink.rb#L20).
I guess those 2 would produce the same error.
The text was updated successfully, but these errors were encountered: