Forums

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

How can I display HTML in a Script Field?

Rick Fox August 21, 2018

I created a Script Field using the HTML template, and I'm returning html as a string, but it's rendering as plain text.  I went to the Field Configuration but am unable to change the Renderer for the field (only the text fields appear to have that option).  Is there something else I'm missing?  The result being displayed is correct html, just as plain text.

1 answer

1 accepted

0 votes
Answer accepted
Mohamed Adel
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.
August 21, 2018

Hi Rick, 

Could you please share the script ?

Regards,

Rick Fox August 21, 2018

Just testing with a simple script:

def issueId = issue.id;
return "<div><p&gtTest - $issueId</p></div>"

 

 

Renders out as:
<div><p>Test - 1443307</p></div>

Mohamed Adel
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.
August 21, 2018

can you please try the following one : 


def issueid = issue.id
return "<html><body><b>Test - $issueid</b></body></html>"
 
Rick Fox August 21, 2018

That worked, thanks! Every example I looked at online was encoding it, just assumed that was correct :(

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events