Hi, community,
I am trying to create an idea using API in a discovery project using Golang. The idea is configured only to require a summary
field. However, the code works when I create another issue type like Task
, it fails when it comes to Idea
This is my code:
func TestCreateIdea(t *testing.T) {
c := client.NewDefaultClient() // returns jira.Client
i := new(jira.Issue) // Init a new issue
//Set the `Project`, `Summary`, `IssueType` of this issue
p := jira.Project{
Key: "DO",
}
i.Fields = &jira.IssueFields{
Project: p,
Summary: "GOOOD",
Type: jira.IssueType{
Name: "Task",
},
}
// Call create function. It uses `rest/api/2/issue` api
_, _, err := c.Issue.Create(i)
if err != nil {
panic(err)
}
}