Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to add an image to a post function email?

arama mihai
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.
Mar 06, 2018

Hello,

I would like to add an image to a post function "ScriptRunner workflow function - Send a custom email" 

I'm currently using the following:

In the email template:

 

Hello.
<br><br>
The <a href="http://buic-jira.conti.de:8080/browse/$issue.key" > $issue.key </a> ticket has been solved. Please provide feedback for it in maximum 2 days:
<br><br>


<img src="${http://buic-jira.conti.de:8080}/images/screen_feedback.png"/>


Summary :
$issue.summary
<br><br>
Description :
$issue.description

The error is: 

Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript402.groovy: 9: unexpected token: < @ line 9, column 1. <br><br> ^ 1 error

I'm not sure what's not okay.

 

Thank you.

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Kyle Moseley
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.
Mar 07, 2018

<img src="${http://buic-jira.conti.de:8080}/images/screen_feedback.png"/>

 

Remove the gstring portion of that and turn it into

 

<img src="http://buic-jira.conti.de:8080/images/screen_feedback.png"/>

Kyle Moseley
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.
Mar 07, 2018

Also I would suggest removing that final / at the end of the img tag.

arama mihai
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.
Mar 07, 2018

Hi Kyle,

Thank you for your reply. That seems indeed correct, and there aren't any more errors after changing it this way, but when the email is sent, it doesn't contain the image.

Do you happen to have any ideas on why this could be?

Thank you.

arama mihai
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.
Mar 07, 2018

Also, when I  try the 'preview' function, it tries to bring up the image, but it looks like this:

 

Screenshot_5.png

Kyle Moseley
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.
Mar 08, 2018

If the image is failing in preview and the email, it leads me to believe the path to the image isn't working. Are you certain that's the correct path? If you click that link do you see the image in your browser?

arama mihai
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.
Mar 12, 2018

Hi,

When accessing the link the image does not appear properly.

I tried with the full path and it looks like this when accessing the URL. 


Screenshot_7.png

 

I also attached an image with how the file looks on the server, to see the full path to it.

 

Screenshot_8.png

arama mihai
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.
Mar 12, 2018

Update:

I also changed the owner and the group for the file to be root, the same as the other files.

The problem is still the same.

I observed that when trying the preview option or when accessing the URL for any default image existing there already, it works.

Any image that I manually add, does not work. I also restarted JIRA after adding one image and changing it to have the same bit depth,  group and root as the others.

any updates on this? any other solution?

Like Z B likes this
Z B
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.
Sep 03, 2020

Hi, I have the same problem

TAGS
AUG Leaders

Atlassian Community Events