Like it says :-) We're currently using a customised release-notes script which picks up the 'Description' field from our issues and writes it into the notes. Unfortunately, this doesn't parse the wiki-syntax... :-)
Is there any way to get releasenotes-html.vm to call the AtlassianWikiRenderer on this field prior to passing it to $textUtils.htmlEncode()?
I just had a similar problem. For some reason you cant get AtlassianWikiRenderer directly with ComponentAccessor, but this code works(with Jira 5.1.8):
EventPublisher eventPublisher = ComponentAccessor.getOSGiComponentInstanceOfType(EventPublisher.class); VelocityRequestContextFactory velocityRequestContextFactory = ComponentAccessor.getOSGiComponentInstanceOfType(VelocityRequestContextFactory.class); AtlassianWikiRenderer wikiRenderer = new AtlassianWikiRenderer(eventPublisher, velocityRequestContextFactory); String wikiString = "*bold*"; String htmlString = wikiRenderer.render(wikiString, null); // "<p><b>bold</b></p>"
It possible to do this also using public-api:
FieldLayoutItem fieldLayoutItem = ComponentAccessor.getFieldLayoutManager() .getFieldLayout().getFieldLayoutItem(IssueFieldConstants.COMMENT); // CommentSystemField JiraRendererPlugin rendererForField = ComponentAccessor.getRendererManager().getRendererForField(fieldLayoutItem); return rendererForField.render("*test*", new IssueRenderContext(null)); // or issue.getIssueRenderContext()
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG