-
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
Not possible to update an existing issue? #100
Comments
I should mention that I'm authenticating with HTTP Basic and that the API user has access to update the record, which I confirmed by logging in as that user and updating the record. |
@endymion I feel your pain. However, your disparaging comments are not productive. The maintainers of this gem volunteer their time to maintain a gem that someone else created, and are under no obligation to help you. I'm sure they don't appreciate your negative tone. If it's so bad, why don't you try using one of the 60 other JIRA gems. I realize it's not mentioned in the README, but there are two files in the repo which list a lot of examples, including updating issues. Perhaps you did not see these examples? I agree, the readme needs some improvement. However, docs aren't a replacement for getting your hands dirty and reading through the source code. |
Good news, guys! The issue was that sometimes url didn't have '/' prefix. |
Have created pull request for you, so you can better understand what's happened and how it could be fixed: #112 |
…ch that when the 'self' attribute exists, the prefix is added to the base of the url.
#119 fixes this issue. |
For what it's worth, I also noticed that the request was leaving the '/' off of the beginning of the URL (e.g. 'https:jira.example.comrest/api/2/blablabla' notice the lack of '/' between 'com' and 'rest'), and what fixed this for me was removing the '/' at the end of the host name I gave the Client object. I changed client = JIRA::Client.new(
username: username,
password: password,
site: 'https://jira.example.com/', # notice the '/' at the end
context_path: '',
auth_type: :basic) to client = JIRA::Client.new(
username: username,
password: password,
site: 'https://jira.example.com', # the '/' has been removed
context_path: '',
auth_type: :basic) |
I found bug in my last fix I made last summer. Since issue is still open - I would like provide a pull request. |
I've spent about the last six hours trying to figure out how to use the JIRA API from Ruby, using this gem, to create, update, and comment on an issue in JIRA. Simple, right? NO. This gem is so poorly documented that it took hours just to log into our JIRA account with it because the secret of using :context => '' is not mentioned anywhere and I had to figure it out myself. Then I had to figure out how to find the IDs for projects and issue types by inspecting the HTML from atlassian.net and I was finally able to post an issue.
Updating an existing issue, however, is a complete mystery. I'm guessing that it will be like the other issues: that it will work if I can find some sample code somewhere. The sample code in the documentation for updating records absolutely does not work. Now I'm just throwing things against the wall to see if anything sticks. I seriously think that I would have been better off pulling out Capybara and writing a web bot to do this instead of trying to use this terrible API gem.
Here are a few examples of failed attempts to post an update to an existing issue. I get a 400 response and no error messages in the issue's data structure.
Result:
That mirrors the structure used to create that same issue, with the fields nested under 'fields'. But obviously it doesn't work. And it provides absolutely no hint about why it didn't work.
Another attempt:
Result:
Another attempt:
Result:
Another attempt:
Same result.
The real issue here is that I'm an idiot for wasting so much of my time on trying to make this work when it's obviously never going to work. Is that correct? Or can this gem actually update issues in JIRA?
If this gem can't update issues in JIRA then why is it wasting space on GitHub?
The text was updated successfully, but these errors were encountered: