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

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

This widget could not be displayed.

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

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

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> 

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

486 views 3 18
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you