How can convert wiki markup to HTML using the JIRA Python API?

I'm trying to pull release notes from JIRA tickets via the Python API and then display them on my company's web site. I am able to retrieve the field containing wiki markup, but am unsure how to convert this to HTML.

I've seen several wiki-to-HTML Python libraries during my Googling, but none seem to be an exact fit for the JIRA wiki markup.

I appreciate any help that is provided!

3 answers

1 accepted

This widget could not be displayed.

I read through the REST API documentation and found a reference to expandable properties. This appeared promising, so I read through the JIRA Python code until I found it in the issue constructor. I was able to do the following:

renderedIssue = jira.issue('TEST-17', expand='renderedFields')
     print renderedIssue.renderedFields.description

In my example above, the description was displayed in HTML rather than the JIRA wiki markup.

Note that I'd tried expanding rendered fields in jira.search_issues -- this is supported in the Python code -- but there appears to be a bug that always returns an empty object in issue.renderedFields (I confirmed this by examining the raw JSON). Thus, I have to retrieve the key from my query results and use jira.issue to retrieve an issue object that has a populated renderedFields object.

I've logged a bug for jira.search_issues at https://jira.atlassian.com/browse/JRA-30718.

This widget could not be displayed.

In addition, we're using some of the optional macros, such as the anchor, code, quote, no-format, panel, and color macros. We put a lot of effort into making our release notes look nice. If there's a solution that doesn't only convert the basic wiki markup but the macros too, that would be fantastic.

This widget could not be displayed.

I've opened an OnDemand support ticket for this and will provide an update once I have a solution.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

225 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you