Currently having no success automatically creating Jira tickets for a specific project that has customfields, multicheckboxes. I'm attempting this in Golang with go-jira (https://github.com/andygrunwald/go-jira)
func main() {
customfield_11882 := tcontainer.NewMarshalMap()
customfield_11882["value"] = "Something"
client, err := connectJira()
if err != nil {
fmt.Println("I CANT CONNECTO TO JIRA error:", err)
return
}
i := jira.Issue{
Fields: &jira.IssueFields{
Description: "Test Description",
Type: jira.IssueType{
Name: "Task",
},
Project: jira.Project{
Key: "WIT",
},
Summary: "Just a demo issue",
Unknowns: customfield_11882,
},
}
issue, response, err := client.Issue.Create(&i)
fmt.Println(response)
body, readErr := ioutil.ReadAll(response.Body)
if readErr != nil {
fmt.Println("Body error:", readErr)
return
}
fmt.Println(string(body))
if err != nil {
fmt.Println("Error: ", err)
return
}
fmt.Printf("%s: %+v\n", issue.Key, issue.Fields.Summary)
}
And I receive this error:
"{"errorMessages":[],"errors":{"value":"Field 'value' cannot be set. It is not on the appropriate screen, or unknown."}}
Error: Request failed. Please analyze the request body for more details. Status code: 400"
Does anybody have a working example in Go for customfields with multicheckboxes?
This is how you can populate the values for custom fields. You can first find out what the custom field names are actually...
once you know what the field names are, set the values ..
customFields := tcontainer.NewMarshalMap()
customFields["customfield_10031"] = "some value ..."
customFields["customfield_10032"] = "some value ..."
customFields["customfield_10033"] = "some value ..."
jiraIssue := jira.Issue{
Fields: &jira.IssueFields{
Summary: "blah blah blah",
Project: jira.Project{
Key: "XXX",
},
Type: jira.IssueType{
Name: "some issue type",
},
Unknowns: customFields,
},
}
Try this:
Example:
customfield_11882 := tcontainer.NewMarshalMap()
customfield_11882["customfield_11882"] = map[string]interface{}{
"id": "123",
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's not a huge number of Golang experts here, so you might want to expand on this for a wider audience.
Could you show us the body of the request that your code builds and posts to Jira?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.