Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to display wiki markup in script custom email?

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

2 answers

1 accepted

1 vote
Answer accepted

I have resolved this issue smile

<% 
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 %>
0 votes
Fazila Ashraf Community Leader Nov 04, 2020

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)}

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you