Forums

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

Unable to create issue for service desk ticketing using rest api

amit_lodhi August 30, 2019

I am trying to create an issue using rest api but I am getting error.

My url is :

 https://avekshaatckt.atlassian.net/rest/api/2/issue/

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

 

I am getting the error: 

{"errorMessages":[],"errors":{"issuetype": "issue type is required"}}

I have also add issue types here:

https://avekshaatckt.atlassian.net/secure/admin/ViewIssueTypes.jspa

 

I have tried for issue type (Bugs, Task,...) but its not working.

 

 

1 answer

1 vote
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2019

Hi @amit_lodhi ,

Based on the JSON payload you have provided, you should be running your REST API POST request using "Task" and not "Tasks". Therefore, could you please confirm "Task" is available as an issueType to your TICK project.

Could you please attempt on running and provide the output generated:

curl -k -u USERNAME \
-H 'Content-type: application/json' \
-H 'Accept: application/json' \
-d '{"fields":{"project":{"key":"TICK"},"summary":"REST ye merry gentlemen.","description":"Creating of an issue using project keys and issue type names using the REST API","issuetype":{"name":"Task"}}}' \
-X POST https://avekshaatckt.atlassian.net/rest/api/2/issue/

Kind regards,
Rafael

amit_lodhi August 30, 2019

Hi @Rafael Pinto Sperafico ,

Thanks for the reply!

I have tried this: 

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

 

but still getting the same error

Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2019

Suggest an answer

Log in or Sign up to answer