JIRA SEND AN EMAIL WHEN A ISSUE IS FINISHED

David Sierra October 18, 2017

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

Comment

Log in or Sign up to comment
Daniel Yelamos [Adaptavist]
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.
October 18, 2017

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

Daniel Yelamos [Adaptavist]
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.
October 18, 2017

You can also check out our documentation here.

David Sierra October 19, 2017

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

Daniel Yelamos [Adaptavist]
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.
October 19, 2017

Can you include your code please?

David Sierra October 19, 2017

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!

David Sierra October 19, 2017

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

TAGS
AUG Leaders

Atlassian Community Events