Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

When using a scripted field (html template) to render items from a Rich Text Field...

Chris Solgat
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.
April 23, 2018

We have a scripted field using an html template that is pulling in comments from a linked issue.  The scripted field displayed correctly in JIRA Software 7.3.1, but is displaying the Markup in JIRA Software 7.6.1.

This is what's currently being rendered by the scripted field --
{color:#ff0000}Requested a revised app with correct broker info and AKA J Smith to match sig on QAR{color} {color:#ff0000}Requested POB as benes are life contingent{color} {color:#ff0000}Requested EFT Auth Form as this is a CA WC case.{color} {color:#ff0000}First pay is 05/01/2018{color} 

Here is how the original comment looked --

Requested a revised app with correct broker info and AKA J Smith to match sig on QAR

Requested POB as benes are life contingent

Requested EFT Auth Form as this is a CA WC case.

First pay is 05/01/2018

 

 

Here is the closure used to append and format the comment in the scripted field.  The $comment.body is how the comment is being pulled.

comments.each{comment ->
def formatter = new SimpleDateFormat("MM/dd/yy HH:mm a")
def s = formatter.format(comment.created)
html.append("<tr><td>$s</td><td>$comment.authorFullName</td><td>$comment.body</td></tr>")
}

What is the simplest manner to get the comments to display the rich text format in the scripted field?

1 answer

0 votes
Chris Solgat
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.
April 23, 2018

My question didn't render the original Comment correctly.  Here's a screenshot that shows the original formatting -- 
commentFormat.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events