How do you create a Jira issue with multipel line description using REST API?

Mont
Contributor
May 8, 2023

To give more context I am asking this question again. I am using version 2 API as noted in error below. I am able to create a single line description with just a string. When I start to follow the documentation below I receive error.

I've attempted to try the solution here https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/

I added this to the description of my python code snippet below but I am still receiving HTTPError: 400 Client Error: for url: https://jira.<domain>.com/jiradc/rest/api/2/issue?updateHistory=false

My code below. I've simplified this for trail and error just to test if it will work to call the JIRA API. Originally it was longer but I still receive error only when adding this to description.

issue_dict = {

"project": {

"id": '123'

},

"summary": "test summary 3",

"reporter": {"name": "id"},

"issuetype": {"name": "Task"},

"priority": {

"name": "Critical"

},

"description": {

"version": 1,

"type": "doc",

"content": []

}

}
 

 

Has anyone been able to successfully create a JIRA ticket with multiple lines in the description or details?

Also is there any additional documentation aside from what's provided in this post for including this in the python-api for jira?

 

 

 

 

1 answer

0 votes
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 8, 2023

Hi @Mont 

Have you try using "\n" for new line ?

Also I don't think you need to use the type etc..

"description": "1er line \n 2nd line"

Maybe "\\n"

Regards

David Bakkers
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.
May 8, 2023

Solution provided to OP in this thread.

OP is reading the wrong documentation for their Jira product.

Suggest an answer

Log in or Sign up to answer