Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,760
Community Members
 
Community Events
165
Community Groups

unable to create a jira task under the epic

Edited
curl --request POST \
--header 'Authorization: Basic YXJ1bmtAdG' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "test jira by api - arun",
"issuetype": {
"id": "3"               ### task id
},
"project": {
"key": "INIT"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "arun ticket",
"type": "text"
}
]
}
]
},
"customfield_10008": "INIT-2907"     ##epic link
}
}'



Error : {"errorMessages":[],"errors":{"issuetype":"The issue type selected is invalid."}}

1 answer

0 votes
Andy Heinzer Atlassian Team Jun 16, 2022

This error message would tend to indicate that this issue type is invalid to create in that project.  Could you try to do the following GET to see what values are returned?

 

curl --request GET \ 
--url
'https://your-domain.atlassian.net/rest/api/3/project/INIT' \
--user
'email@example.com:<api_token>' \
--header
'Accept: application/json'

This query should be able to tell you the ID of the project.  With that number, you can then query which issuetypes can be created there in

curl --request GET \ 
--url
'https://your-domain.atlassian.net/rest/api/3/issuetype/project?projectId={projectId}' \
--header 'Authorization: Basic [encodedtoken]' \
--header
'Accept: application/json'

This can then give us the id of the issuetypes in that project. 

 

From there I'm interested to see if you can send a POST call to just create an issue of this type (even without trying to set the Epic in the issue create call).  Curious to learn more here.

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you