Forums

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

How to convert description field to markdown

Vishal Biyani
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.
January 23, 2022

While using JIRA Cloud REST API V3.0, description is coming JIRA ADF format. Is there a way to convert this format to markdown syntax, html so that same can be stored in database?

 

tried looking at pyadf library. However, it has functions to convert text to ADF. Didn't find anything to convert from ADF to other formats.

4 answers

1 accepted

3 votes
Answer accepted
Vishal Biyani
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.
October 20, 2022

Just in case anyone else hits this thread, what i ended up doing was expanding the json response using renderedFields. This gives description in html format. then use python library  markdownify to convert the output to markdown syntax.

 

It is working fine for my usecase

1 vote
Marlen Brunner
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!
October 2, 2024

I used ChatGPT to write this code to fetch issue and do a pretty minimal conversion to Markdown. Hopefully Jira will make this a stock feature and save me some time.

0 votes
Vishwas
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.
January 23, 2022

Hey @Vishal Biyani 

Please check this thread here about same requirement https://community.atlassian.com/t5/Jira-questions/convert-jira-ADF-formatted-description-in-HTML-format/qaq-p/1750152

And there is an open issue reported on this here https://jira.atlassian.com/browse/JRACLOUD-77436

Please check the comments that might be helpful.

 

Regards,

Vishwas

0 votes
Pramodh M
Community Champion
January 23, 2022

Hi @Vishal Biyani 

So you want the Issue Description to be posted in Markdown format via API. Please correct me if I'm wrong here.

Description field follows Atlassian Document Format content

Please follow the reference here

https://developer.atlassian.com/cloud/jira/platform/apis/document/structure

Let me know how need the format

Thanks,
Pramodh

Vishal Biyani
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.
January 23, 2022

@Pramodh M 

Thanks for your quick response. 

Question is How to parse though content node? 

Do i need to create a custom json parser that reads through all the content nodes?

if so, when i hit say Node - hardbreak, what needs to be done to convert it to markdown syntax?

or when Node - table comes, what needs to be done to convert it to equivalent markdown syntax?

 

is there any handy reference that i can go through for this conversion?

Like viniciusfeitosa_eireli likes this

Suggest an answer

Log in or Sign up to answer