# Extracting Comments in HTML code

**URL:** <https://community.developer.atlassian.com/t/extracting-comments-in-html-code/4598>\
**Category:** Jira Server\
**Tags:** atlassian-wiki-renderer, export, comment, jira-server, java\
**Created:** [June 1, 2017, 7:58am UTC](https://community.developer.atlassian.com/t/extracting-comments-in-html-code/4598 "2017-06-01T07:58:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@Felix](https://community.developer.atlassian.com/u/Felix)\
**Post date:** [June 1, 2017, 7:58am UTC](https://community.developer.atlassian.com/t/extracting-comments-in-html-code/4598/1 "2017-06-01T07:58:21Z")

</div>

Hey guys,  
I’m having a Problem again.

**I want to export Comments to a separate HTML file, but I only get a Wiki Markup String like this:**

> - df_g_dfg \* dsf\_ssd\_f \* s+dfs+df \* s{color:red}df^sd^f \* sdfsd{color}(_y) (_)(x)(?) {code:java} // Some comments here public String getFoo() { return foo; } {code} ||Heading 1||Heading 2|| |Col A1|Col A2

**But I would like to have it look like this:**  
 ![](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/4/d/4df3bbdd0babbb2f1d3373d6d66de0141c810bb1.png)

**Is there any good way of doing this ?**

I already found [AtlassianWikiRenderer](https://docs.atlassian.com/jira/6.4.9/com/atlassian/jira/issue/fields/renderer/wiki/AtlassianWikiRenderer.html) and [DefaultCommentFieldRenderer](https://developer.atlassian.com/static/javadoc/jira/6.3-m04/reference/com/atlassian/jira/issue/fields/renderer/comment/DefaultCommentFieldRenderer.html), but I don´t really know how to use them.

---

<div class="post-metadata">

**Author:** ![Felix](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@Felix](https://community.developer.atlassian.com/u/Felix)\
**Post date:** [June 1, 2017, 11:09am UTC](https://community.developer.atlassian.com/t/extracting-comments-in-html-code/4598/2 "2017-06-01T11:09:46Z")

</div>

_OK,_  
**_I got it working._**  
Maybe this can help someone in the Future:

I used **AtlassianWikiRenderer** , for that I needed to **add** the **JIRA-Core dependency in the POM.xml**.

The code to render the Wiki annotated string to an HTML annotated string looks something like this:

> ```auto
> AtlassianWikiRenderer atlassianWikiRenderer = new AtlassianWikiRenderer(eventPublisher, ComponentAccessor.getApplicationProperties(), velocityRequestContextFactory);
> dataMap.put("commentHtml", atlassianWikiRenderer.render(comment.getBody(), new IssueRenderContext(issue)));
> 
> ```

I’m putting this in to a map because **I want to render the output with Velocity** , that´s also the reason why the **Key ends with “Html”** , because when that´s the case _Velocity is not going to escape the String_ **and** it **is** going to be **displayed properly**.

If someone else has a better Idea though, please let me know.

---

<div class="post-metadata">

**Author:** ![EvgeniyBelov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/evgeniybelov/32/39341_2.png) [@EvgeniyBelov](https://community.developer.atlassian.com/u/EvgeniyBelov)\
**Post date:** [February 25, 2020, 11:21pm UTC](https://community.developer.atlassian.com/t/extracting-comments-in-html-code/4598/3 "2020-02-25T23:21:33Z")

</div>

I’m having difficultly in finding the jar to download for this class. Is it still in Maven?

Thanks
