Unable to create idea using create issue api?

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)
	}

}

Hello @LongKangFan

When the request fails, what is the error message that comes back from the REST API?
Do you get the same error if you refer to the Idea issue type by its ID instead of its name?
What testing have you done of the same request to the same API endpoint with your API test tool?

1 Like

Hi @sunnyape

Do you get the same error if you refer to the Idea issue type by its ID instead of its name?

It passes when change the name to ID!

Thanks!

1 Like