The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • rest api to create sub task error out Operation value must be an Atlassian Document (see the Atlassi

rest api to create sub task error out Operation value must be an Atlassian Document (see the Atlassi

John Sheng
March 19, 2022

Hi, 

I am able to create jira issue (issue type = story) using api. 

and then I follow this instruction to create sub-task. 
I feel the json is correct. but it gave me error message: Operation value must be an Atlassian Document (see the Atlassian Document Format)"

 

 

 

{
    "fields":
    {
        "project":
        {
            "key""WDEXTEND"
        },
        "parent":
        {
            "key""WDEXTEND-24"
        },
        "summary""Sub-task of TEST-101",
        "description""Don't forget to do this too.",
        "issuetype":
        {
            "_id""5",
            "name":"Sub-Task"
        }
    }
}

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Hana Kučerová
Community Champion
March 20, 2022

Hi @John Sheng ,

please, which REST API endpoint are you using? Which instructions are you following? Thank you.

Hana Kučerová
Community Champion
March 21, 2022

Hi @John Sheng , please try something like this:

{
"fields": {
"summary": "Sub-task of TEST-101",
"issuetype": {
"id": "5"
},
"project": {
"key": "WDEXTEND"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Don't forget to do this too.",
"type": "text"
}
]
}
]
},
"parent": {
"key": "WDEXTEND-24"
}
}
}

If you are using v3 of REST API, description field needs to have different format, see here.

John Sheng
March 23, 2022

Thank you so much. it works perfect!

John

Tharaka Sampath
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!
November 28, 2022

Works for me also, Thank you @Hana Kučerová 

Like Hana Kučerová likes this
0 votes
John Sheng
March 20, 2022