ScriptRunner Custom Email: Include issue type icon in body of email template

MEDITECH ADMIN TEAM April 26, 2017

I am using the 'ScriptRunner workflow function - Send a custom email' on the Create transition for a specific issue type.  I would like to display the corresponding issue type icon in two places within the email body.

Could anyone provide me a suggestion on how to do this?

My email template is as follows:

<% out << issue.reporter?.displayName %> <b> created </b> an issue <br>

<p style="border:1px; border-style:solid; border-color:#ADD8E6; padding: 1em;">
$issue.project.name / (insert icon here) <a href="$baseUrl/browse/<% out << issue.key %>">$issue</a> <br>

<a href="$baseUrl/browse/<% out << issue.key %>"><b><font size="4">$issue.summary</b></font></a> <br><br>

Issue Type: (insert icon here) $issue.issueType.name <br>
Assignee: <% out << issue.assigneeUser?.displayName %> <br>
Created: ${issue.getCreated().format('MM/dd/yyyy HH:mm')} <br>
Reporter: <a href="$baseUrl/browse/<% out << issue.reporter %>"><% out << issue.reporter?.displayName %></a><br></p>

1 answer

1 vote
JohnsonHoward
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 27, 2017

Hi MEDITECH,

 

$issue.getIssueType().iconUrl will give you the icons url but without the base url, so you will need to add that. Give that a try and let me know if it works.

 

Thanks,

Johnson

MEDITECH ADMIN TEAM April 27, 2017

Thank you for your response. I will try this out and get back to you.

MEDITECH ADMIN TEAM May 2, 2017

I can not yet get this to work.  What I would like to do is to place the issue type icon directly to the left of the issue key like it is in the standard Atlassian notification emails.

Below is what I use right now to display a link to the issue.  I've tried inserting $issue.getIssueType().iconUrl in various places within this line but I cannot get the icon to display. Where specifically does this need to be inserted?  Thank you for any additional assistance.

<a href="$baseUrl/browse/<% out << issue.key %>"> $issue</a> 

Eric Collins March 28, 2018

@MEDITECH ADMIN TEAM would using ${helper.render(issue.key)} be better than the <a> ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events