I know this has been asked countless of time. Unfortunately I still can't get it to work. So my apologies in advance.
I'm trying to create a sub-task from an existing EPIC ticket which has a key value of ABC-123. My curl command is below.
curl -D- -u user:user -X POST --data {"fields":{"project":{"key":"ABC-123"},"summary":"Sub-task of ABC-123","description":"Don't forget to do this too.","issuetype":{"id":"5"}}} -H "Content-Type:application/json" https://localhost:8080/rest/api/2/issue
..and this is the error I'm getting
{"errorMessages":["Unexpected character ('f' (code 102)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@5db919f1; line: 1, column: 3]"]}
Hello @mb cebrian
Welcome to the community.
Can you try this code below :
{ "fields": { "project": { "key": "TEST" }, "parent": { "key": "TEST-101" }, "summary": "Sub-task of TEST-101", "description": "Don't forget to do this too.", "issuetype": { "id": "5" } } }
Look if your issuetype id for subtask is correct. The project key in your code look wrong for me. The parent is missing too.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
here the doc to find the issuetype id:
https://confluence.atlassian.com/jirakb/finding-the-id-for-issue-types-646186508.html
But you can try this:
issuetype={"name":"Story"}
instead of :
"issuetype": { "id": "5" }
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Mohamed Benziane
I was able to get it to work. Worth noting as well that I had to enclose
{"fields":{"project":{"key":"TEST"},"parent":{"key":"TEST-101"},"summary":"Sub-task of TEST-101","description":"Don't forget to do this too.","issuetype":{"id":"5"}}} with single quote.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.