I would like to convert wiki markup from custom field (free text) to HTML by the script runner post function - send custom email.
How would the path look like?
Now I have the wiki style:
<% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Expected Problems")) %>
2015-08-07_11h51_49.png
I have resolved this issue
<% def rendererManager = com.atlassian.jira.component.ComponentAccessor.getComponent( com.atlassian.jira.issue.RendererManager.class) def fieldLayoutItem = com.atlassian.jira.component.ComponentAccessor.getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem(componentManager.getCustomFieldManager().getCustomFieldObjectByName("field name")) def renderer = rendererManager.getRendererForField(fieldLayoutItem) String desc = renderer.render(issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("field name")), null) %> <%= desc %>
For any one who was looking for a solution on this, scriptrunner documentation has a latest solution. See https://scriptrunner.adaptavist.com/5.0.9/jira/builtin-scripts.html#_send_a_custom_email
If you are sending HTML mails you will want fields containing wiki markup to be converted to HTML. You can use the following code in your templates.
${helper.render(issue.description)}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.