HTML to Wiki Style Renderer markup

abagchi October 31, 2013

I'm doing a POC migrating cards from a Mingle install (v13.3) to JiraAgile (v6.1) via the provided api's. I'd like to migrate the Mingle card descriptions over to the Jira Issue description field - given Mingle will provide (fairly complex) HTML, is there a way to programmatically convert this to the wiki style markup? I've looked at some suggestions around using the Mylyn wikitext standalone library, together with the confluence-core, but this only seems to provide converting wiki markup -> html.

Many thanks in advance.

4 answers

1 accepted

3 votes
Answer accepted
abagchi November 13, 2013

Just a note that I found an acceptable solution (for me) in case anyone else has a similar requirement.

Once I had extracted the HTML description field for a card from Mingle using the Mingle api, I did some basic cleanup using the Jsoup HTML parser library (http://jsoup.org/), and then used the gwtwiki library (https://code.google.com/p/gwtwiki/), together with a custom IHTMLToWiki implementation (ToJira.java) to convert the Mingle description HTML to Jira markup tags. Then just create and import the issues using JRJC.

The conversion code is then very simple:

private String convertHtml(String text) {
    String cleanText = Jsoup.clean(text, Whitelist.relaxed());
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML(cleanText);
    String convertedText = conv.toWiki(new ToJira());

    return convertedText;
}

It's not ideal, but good enough!

Simon Graham October 9, 2014

Hi Anton,

How far did you get with this effort? We have exactly the same issue, of migrating cards from a Mingle project into JIRA. Would you be willing to share what you did?

Thanks,

Simon

 

abagchi October 10, 2014

Hi Simon, Are you looking for more information regarding the description markup conversion, or the migration process as a whole? The migration process was fairly involved, but completed successfully (approx. 5000 Mingle cards). Let me know and I'll try and provide some additional info. Anton Anton

Tanuja V March 8, 2016

Hi Anton,

Your comment was helpful. Can you send ToJira.java and the relevant files? That will be a great help.

Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2017

Hi @abagchi,

I have same requirement so i used you mentioned code. also use the required dependency. but i am getting error in the following line. 

  String convertedText = conv.toWiki(new ToJira());

 basically i did not found the API for ToJira()  so I used ToWikipedia() it doe not shows any error in the eclipse but after running the code i am getting this error 

 Caused by: java.lang.NoClassDefFoundError: info/bliki/html/wikipedia/IHTMLToWiki

 

Is there any solution for this?

 

Thanks

Sachin

0 votes
Martin Cleaver
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.
July 28, 2020

One could probably host https://github.com/Qazzian/html2jira in an AWS Lambda and make it available over REST.

0 votes
Radek Janata February 28, 2020

Hi, I was able to resolve this when I needed to convert JEditor fields (stored in HTML) to wiki. See my answer here, it may help too:
https://community.atlassian.com/t5/Jira-questions/Move-to-Rich-Text-Editor-Jira-from-Jeditor-by-Bobronix/qaq-p/692058#M231264

0 votes
Nico K July 5, 2018

Does anyone have a .NET lib or Nuget Package they can recommend..?

Venkat A January 13, 2022

Hi Nico,

You found anything in .NET?

Suggest an answer

Log in or Sign up to answer