Forums

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

Getting Error {"errorMessages":[],"errors":{"issuetype":"Specify an issue type"}}, how to fix this?

siri g
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2023

Hi,

 

I'm trying to build Jira automation script and below is the script and I been keep on getting this error {"errorMessages":[],"errors":{"issuetype":"Specify an issue type"}}, I tried multiple work arounds adding issue type but neither works. Let me know if you can help on workaround

 

import requests
import json

headers = {
         "Accept": "application/json",
         "Content-Type": "application/json"
          }
_payload = json.dumps(
    {
        "fields": {
            "project":
                {
                    "key": "AS"
                },
            "summary": "test summary ye merry gentlemen",
            "description": "Test description",
            "issuetype":
                {
                    "name":"task"
                }
               
        }
    }
)
response = requests.post(url, headers=headers, data= _payload, auth=("username", "ATATT3xFfGF0Z5qiPLOwB8PZoyQ0uiB9eYMfe94IOweLmfZ88GULhmB7TuposTGtAjA25tIShk19Ar6LhKIthV_DOW_3i70cJksiVMlQy8A_MNspw0jjPlEJcXhwTxVp-aFsIlU2O4W5q85lYk6rNiuj9JK0Z1EQcVjs2ly4vIFSHRzMEjL2JTo=85C16638"))
print(response.text)

2 answers

1 vote
Mikael Sandberg
Community Champion
February 24, 2023

Hi @siri g,

Welcome to Atlassian Community!

Your issue type definition is wrong, you need to use the internal Id for the issue type, not the display name.

It should look something like this:

"issuetype": {

    "id": "10000"

}, 

There are a couple of ways to get the Id, have a look at this KB for more information.

Sergei Bershadskii
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 24, 2025

Hello! I'm receiving the same error while creating an issue via the JIRA Cloud extension in Slack, in the scope of automation. It has worked for a long time till today. I can not manage the requests it sends or the issue types it fetches itself.

0 votes
DANIEL FERREIRA DE SOUZA
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 23, 2025

It would then be the case to correct the documentation, which clearly states that the request would be as follows:

 

curl \
    -D- \
    -u charlie:charlie \
    -X POST \
    --data {} \
    -H "Content-Type: application/json" \
    http: //localhost:8080/rest/api/2/issue/

 

{
    "fields": {
        "project": {
            "key": "TEST"
        },
        "summary": "REST ye merry gentlemen.",
        "description": "Creating an issue using project keys and issue type names with the REST API",
        "issuetype": {
            "name": "Bug"
        }
    }
}

 

Mikael Sandberg
Community Champion
January 23, 2025

@DANIEL FERREIRA DE SOUZA, the documentation you are referring too only applies to Data Center, the API for Cloud, which the question was for, is different. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events