JIRA SEND AN EMAIL WHEN A ISSUE IS FINISHED

Hi:

Using ScriptRunner plugin, I've been able to get you to send a message by changing the status to "Done", but I have two problems:

1-I cannot send the email in HTML, it sends in simple text, I have seen this documentation http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_creation_of_a_template_engine, but I don't understand how it works.

2-My idea is to send the email automatically to the url of one of the custom fields. This custom field receive the data in XML format, the output is only the email address but in the preview of this plugin, I see this: <content>,<value>dsierrafernandez@euro-help.es</value>,</content>. Is there a solution?

Anyone knows how to solve this two points?

Best regards,
David Sierra

1 comment

Hi David.

I don't know if #2 is possible to be honest.. Regarding how to send you email in HTML, Jenna answered a question about this awhile ago, you can see it here.

I'm going to try to search for an example you can use.

Cheers!

DYelamos

You can also check out our documentation here.

Dear Daniel:

Thank you for your help!

I'm trying to do an email, but I don't understand how it works hte scripts, or the Groovy script. If I put a template in the "Email template" field of ScriptRunner, I have this error: 

"Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript2.groovy: 2: illegal string body character after dollar sign; solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 2, column 42. plate() { return { out -> out << """ISSU ^ 1 error"

Do I need a Script to send the email?, I can't send an email (with the parameters of the issue like the .key, .displayName...) without the script?

Greetings,

David Sierra

Can you include your code please?

The #2 works well, not in the preview, but it sends the email ;)

Just I need to send variables in the email (the issue key for example).

Thanks!

I have take, like an example, a template from another plugin (notifyme):

ISSUE DETAILS:

Issue: $!issue.key - $!issue.summary
Reporter: $!issue.reporter.displayName
#if($issue.assignee) Assignee: $!issue.assignee.displayName
#end #if($issue.description) Description: $!issue.description
#end

You can write ordinary test likes this one:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam tincidunt ex nec sapien pellentesque, sit amet placerat sem euismod. Vestibulum pellentesque libero sed arcu dictum elementum. Sed tempus aliquam eros, vehicula aliquet velit pretium vel. Etiam tristique mi felis, sed vestibulum nunc sodales sit amet. Aenean viverra, magna at finibus convallis, sem leo posuere quam, a pellentesque nisl nunc quis lacus. Cras volutpat, turpis sit amet pulvinar suscipit, felis ante convallis elit, ut ullamcorper metus metus sit amet velit. Nunc ornare sollicitudin condimentum. Quisque et lacus ut dolor dignissim interdum. In dictum nec risus eget pulvinar. Vestibulum ligula sem, rhoncus quis fermentum in, sollicitudin ac tellus. Sed at malesuada neque, et feugiat enim. Curabitur nulla tortor, euismod vel faucibus a, consectetur vel elit. Duis hendrerit libero eget consequat iaculis. Vivamus bibendum velit ultricies nisi posuere, vitae tristique risus eleifend. Duis in ex convallis, dignissim velit elementum, pellentesque libero. In imperdiet vestibulum turpis, vitae dictum nunc. Cras non diam a enim viverra rutrum. Fusce suscipit dolor vitae tortor vulputate, nec porttitor mi gravida. Nulla viverra magna eu urna rutrum, sit amet aliquam mi viverra.

#if($notifymeHtml)

Test Notify Me! integration just add $!notifymeHtml in your template and that's all!

#end

#foreach($comment in $!comments) $comment.authorApplicationUser.displayName:
$comment.body #end

 

All rights reserved - 2016 atsistemas.com

Comment

Log in or Sign up to comment
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,748 views 18 21
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