Forums

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

Linking a subtask to another subtask JSON JIRA API

roliveiras1994 October 3, 2018

I am trying to create a new subtask on a project already including the link to a parent (another subtask) in JSON. 

I wasn't able to find any code to do such a thing.

 

Here is my code: 

 

{

"fields":
{
"project":
{
"key": "task"
},
"parent":
{
"key": "subtask"
},
"summary": "TesteAutomacaoJiraPai",
"description": "Teste Automacao Jira",
"issuetype":
{
"name": "ToDo"

},
"assignee":
{
"name": "user"
}

},
"update": {
"issuelinks": [{
"add": {
"type": {
"name": "Child-Issue",
"inward": "is child task of",
"outward": "is parent task of"
},
"outwardIssue": {
"key": "BLOQUEV-17611",
"fields": {
"summary": "Test Adapter"
}
}
}
}]
}
}

I have already created the BLOQUEV-17463 and the BLOQUEV-17611 

 

I am doing the command bellow:

 

curl -k -D- -u usarname:password -X POST --data @1.json -H "Content-Type: application/json" https://xxxxx/rest/api/latest/issue/

 

and it keeps showing me this error: {"errorMessages":[],"errors":{"issuelinks":"Field 'issuelinks' cannot be set. It is not on the appropriate screen, or unknown."}}

 

thanks in advance..

 

1 answer

1 accepted

2 votes
Answer accepted
roliveiras1994 October 4, 2018

already solved it , but i wasnt able to create a new subtask already linked to another subtask.

I created the two sub tasks then created a link.

 

that is my Json:

{
"type": {
"name": "Child-Issue"
},
"inwardIssue": {
"key": "subtask1"
},
"outwardIssue": {
"key": "subtask2"
}

}

 

cmd command:

 

curl -k -D- -u user:password -X POST --data @.json -H "Content-Type: application/json" https://xxxx/rest/api/latest/issueLink

Elon Chan
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!
June 13, 2019

it really helped me !!

i forgot the outwardIssue then i failed and failed!

Suggest an answer

Log in or Sign up to answer