Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

"Test type: Test type is required" Error response when using Jira REST API to create a issuetype Tes

Zeus_Cortes February 11, 2020

I am trying to create an issue with type test with the following code:

{
"fields": {
"project": {"id":"21201"},
"summary":"New test issue",
"description":"Look into this one",
"issuetype":{"name": "Test"},
"reporter": {"name": "validUser"}
}
}

The code works when I substitute the issuetype for "name": "Bug", but not when I use Test.
I understand that there are required metadata that must be defined and I've looked up all the required fields for a Test issue type, I cannot find anything related to a "test type".

The is the error message:

{
"errorMessages": [
"Test Type: Test Type is required."
],
"errors": {}
}

Anybody experience this problem before or able to offer some help? 

1 answer

0 votes
carlosughini
Community Champion
February 11, 2020

Hello Zeus,

Welcome to our community!

My apologies if I have misunderstood your question, but do you have the issue type "Test" on your instance? From what it seems, if you are able to create using "name":"Bug" and not with "test", maybe you do not have the Test issue type on your instance.

I strongly recommend checking the documentation below about issue type:

 

Additionally, try listing all your issue types and ensuring that you are using the right name or id. You can list them all with the following endpoint:

<JIRA_url>/rest/api/latest/issuetype

Looking forward to hearing from you.

Cheers,

Carlos

Zeus_Cortes February 11, 2020

Hey Carlos! Thank for helping out.

So I got found the issue type within the response from that endpoint:

{
"self": "<JIRA_URL>/rest/api/2/issuetype/10102",
"id": "10102",
"description": "This Issue Type is used to create Zephyr Test within Jira.",
"iconUrl": "<JIRA_URL>/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png",
"name": "Test",
"subtask": false
}


Additionally, I can create Test issues manually through the GUI inside the same project that I am pointing at.

Anything thoughts?

Suggest an answer

Log in or Sign up to answer