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

1 vote
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 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

Suggest an answer

Log in or Sign up to answer