-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
IssueUpdate -- Issue error occured: Request failed. Please analyze the request body for more details. Status code: 400 #197
Comments
@carljthompson Hey, thanks for the issue. |
@carljthompson you are ignoring the response here:
that |
|
Thanks @ghostsquad, do you think it makes sense to add this to the README as troubleshooting? |
@andygrunwald I think the error should be useful. ;) |
@ghostsquad Maybe something like this? #196 |
@carljthompson did you solve this problem? |
I'm having what looks like the same issue. l := make(map[string]interface{})
l["update"] = `{"components":[{"set":""}]}`
resp, err := client.Issue.UpdateIssue("FOO-7573", l)
lines, _ := ioutil.ReadAll(resp.Body)
println(string(lines)) That code produces the following error:
with an http status of 400, so I get the feeling that I'm formatting the map incorrectly. |
I ended up just using req, err := jclient.NewRawRequest("PUT", "rest/api/2/issue/FOO-7594", bytes.NewBufferString(`{"update":{"components":[{"add":{"name":"BAR"}}]}}`))
req.Header.Set("Content-type", "application/json")
jclient.Do(req, nil) Refer to jira docs for more info. It's not really an answer but it works for me, just posting in case somebody else was having trouble. |
I think the problem is that you are mixing string and object. @carljthompson your example will result in the following json: The proper way is to use objects see https://play.golang.org/p/FEX-q6er4gF this will produce the following json: |
I'm closing this issue, but labeling it as a reminder for v2 ideas. I think error reporting could be improved. |
@ghostsquad I'm hitting the same error on login. Why is this issue closed? It looks like a simple error reporting fix would help with debugging a whole lot. |
Reopened to get the v2 visibility. @wkoszek Would you be open to create a PR and give it a try? |
@andygrunwald https://pastebin.com/CKG9R2tH <- do you know how to workaround this Golang issue? |
@wkoszek Never had this case. Sounds scary and seems to be a hack, somehow. Maybe this can worth a try? |
@andygrunwald I looked at the code. I attempted to make a fix by simply carrying 'error' value up in the stack to the top layers of the code. Unfortunately a bunch of unit tests failed, because there are places in the code where you create your own error messages. In the meantime, I've switched to https://github.com/go-jira/jira which after solving some hiccups (go-jira/jira#369) appears to work. Feel free to close this issue. |
Hey, I am very sorry that this issue has been open for a long time with no final solution. We work on this project in our spare time, and sometimes, other priorities take over. This is the typical open source dilemma. However, there is news: We are kicking off v2 of this library 🚀To provide visibility, we created the Road to v2 Milestone and calling for your feedback in #489 The development will take some time; however, I hope you can benefit from the changes. What does this mean for my issue?We will work on this issue indirectly. Final wordsThanks for using this library. |
I successfully connected to our JIRA instance and pulled in the details of an issue. I am trying to just add a label to an existing issue using IssueUpdate. I couldn't find a good example. I did drill into the code (issue.go | UpdateIssue ) and see the JIRA link (https://docs.atlassian.com/jira/REST/7.4.0/#api/2/issue-editIssue)
Here is the code I am using:
package main
import (
"fmt"
"github.com/andygrunwald/go-jira"
)
func main() {
}
I receive the following error every time
Issue error occured: Request failed. Please analyze the request body for more details. Status code: 400
My JIRA system account has administrator privileges.
Could you give me a good example or assist me if there is a bug in IssueUpdate pertaining to labels?
The text was updated successfully, but these errors were encountered: