How display issue type icon in email?
Asked by Shah Baloch:

I created a schedule that pulls high-priority issues that have not been updated in two days and it will send the list of the issues to the assignees via email. However it does not include issue-type icons, it is just sending issue types' names. Is there a way to include issue-type icons?

```
{{#issues}}
<tr>
<td>{{key}}</td> 
<td>{{issueType.name}}</td>
<td>{{summary}}</td> 
<td>{{status.name}}</td>
<td>{{assignee.displayName}} &emsp; </td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
</tr>
```

![automation_02212022.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/184642i3273FB60D250E2F6/image-size/large?v=v2&px=999 "automation_02212022.JPG")

Any idea how to include icons?

Thank you


Answers:
author: Mykenna Cepek
body: There may be a better solution, but I'll suggest an approach I'd use to solve this.

I see you're using Jira Server, which I don't have access to. I'll *show my work* here for a Jira Cloud solution, and you can replicate the effort to find what works for you.

I'd start by investigating the URLs that Jira uses to display the issue type icons of interest. After all, they are just image files that all your Jira users already can access.

In the Chrome browser, I can right-click on an icon and use "Open image in new tab". Doing this on an issue type icon in Jira will reveal a URL to that icon. In my Jira Cloud instance for an Epic issue type icon, I see:

```
https://xxx.atlassian.net/images/icons/issuetypes/epic.svg
```

I was able to replace "epic" with "story" and "subtask" in my instance and see the right icons.

Based on this, I created a test rule which replicated part of your table:

![Screen Shot 2022-03-03 at 10.44.17 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/186289iB1EABDD603BCA872/image-size/large?v=v2&px=999 "Screen Shot 2022-03-03 at 10.44.17 AM.png")

This simply maps {{issueType.name}} to all lowercase letters and embeds it in the URL for the icon. Here's a text version of that magic line above (for easier copy/paste):

```
<td><img src="https://xxxx.atlassian.net/images/icons/issuetypes/{{issueType.name.toLowerCase()}}.svg"/></td>
```

Testing my rule showed me this in an email:

![Screen Shot 2022-03-03 at 10.47.32 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/186290i32C17F82974928E2/image-size/large?v=v2&px=999 "Screen Shot 2022-03-03 at 10.47.32 AM.png")

I can't explain the odd border on the first icon. Hopefully it looks normal for you.

_ _ _ _ _ _ _

A few additional notes about this approach:

* Reminder: the URLs shown here might differ from what your Jira instance uses for issue type icons. You'll have to discover what URLs to use for your Jira.
* In my Jira Cloud instance, some of my icons came back with a different URL path like:  
  xxx.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium  
  which I ended up ignoring. Instead I hacked the "nice" URL that I found for one icon to make that URL format work for all the icons of interest.
* An assumption in this solution is that that the {{issueType.name}} perfectly maps to the icon names in your instance. That assumption may not hold for all issue types in your instance. In that case, you'll need a different approach. Instead of a single smart value expression using toLowerCase(), you'll need a series of conditionals like the following example:

```
 <td><img src="http://xxx.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/{{if(equals(issueType.id,10000))}}10315{{/}}{{if(equals(issueType.id,10001))}}10312{{/}}?size=medium"/></td>
```

This is ugly, and a bit brittle. But it'll work!

comments: author: Shah Baloch
body: [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113)I was able to view icons by using <https://myjira.com:8080/images/icons/issuetypes/task.svg>.

I used the first method, the below code:

```
<td><img src="https://myjira.com:8080/images/icons/issuetypes/{{issueType.name.toLowerCase()}}.svg"/></td>
```

it didn't display the icons. It displays image missing icons, here is the screenshot:

![automation_03072022_01.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/186817i4B1C5FEBD1F4DAA3/image-size/large?v=v2&px=999 "automation_03072022_01.JPG")

I did right click and selected "Download Pictures" from outlook, it still didn't display icons. it displayed the below icons:

![automation_03072022_02.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/186818iB7E126091FB00BE2/image-size/large?v=v2&px=999 "automation_03072022_02.jpg")

I was not sure about the second method because of those two numbers 10000 and 10315. Are these avatar ids? Where I can find it? I found the below code when I right-clicked on the task icon from the issue type and went to inspect.

\<img src="[https://myjira.com:8080/secure/viewavatar?size=xsmall\&amp;avatarId=11218\&amp;avatarType=issuetype](https://myjira.com:8080/secure/viewavatar?size=xsmall&amp;avatarId=11218&amp;avatarType=issuetype)" height="16" width="16" border="0" align="absmiddle""\>

Thank you for your help.


author: Mykenna Cepek
body: If you can view the task.svg icon in your browser but not in an Outlook email, that sounds like it might be an Outlook thing. More on that later...

The second method I showed is using two numerical values, and it may be confusing. In my example, 10000 and 10001 are what Automation sees for {{issueType.id}}, so you can output those to the Automation Audit Log to see what those values are in your Jira Server instance for each Issue Type.

In my example for the second method, the numbers 10325 and 10312 are the avatarId values. So use those when constructing the URL in the conditionals. You'll also want to change the URL to match what you see when you right-click and inspect the task icon (rather than using what I posted).

Sounds like you've got the right approach. Just fuss with those details. If the URL looks right, but Outlook isn't showing it, maybe talk to a coworker who has worked with HTML in email at your workplace. Maybe the Jira base URL needs to be added to an Outlook whitelist so it can be treated as a safe source for images? Just a wild guess.


author: Barnaby Falls
body: Is there a way to include the issueType icon in a Slack message?


author: Boris Berenberg - Atlas Authority
body: If you're open to using a tool other than Automation, we support issue type icons in [Notification Assistant for Jira](https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email?hosting=server&tab=overview).


author: Josh Costella
body: Not sure if this will work... haven't tried but maybe try:

```
<td>{{issueType.icon}}</td>



OR


<td>{{issueType.avatar}}</td>
```

comments: author: Shah Baloch
body: Thank you [@Josh Costella](/t5/user/viewprofilepage/user-id/1172532) for your response. Unfortunately, it didn't work. Thanks


Tags: email

filter

issue-type

jira-server

schedule