Hi!
I need advice.
I use built-in script "Send custom email": https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-SendCustomEmail
Event: Issue commented
Condition: issue.status?.name == 'New'
Subject template: Issue $issue was commented
How can I paste new comment in 'Email Template'?
Thanks for finding that Daniel... however I think that will fall over when there are no comments.
I have updated the sample template in https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail (Point 3).
Make sure you use the if, or if you don't, at least test it with an issue with and without comments in builtin scripts -> Send a custom mail (which is used for testing templates).
Jamie,
How do you get the comment of the last transition - if any.
lastComment is set, even if the transition didn't have any comment,
so containing a comment which is not relevant to the transition.
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah... that's no good is it. Can you create a bug, I will try to fix. I don't think the email template has access to transientVars or event, to get the comment added on that transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Access to transientvars would fix this issue.
https://jamieechlin.atlassian.net/browse/GRV-449
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And the event if it's a listener, but yes indeed. Thanks for the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist], how can I get, in a custom email template, the transition's comment author? Thank you in advance Arianna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It will be: comment.author
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist] , if I use <% out << comment.author %> I get, on preview, No such property: comment for class: groovy.lang.Binding Any suggestion? Thank you again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"comment" is not in the binding, see https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-CommentsinEmails
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, it wasn't as simple as I thought.
try
<% out << componentManager.commentManager.getComments(issue)?.last()?.body %>
Found the answer in this comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
simply adding the line:
$comment.getBody()
should "paste" the new comment into the email.
You should check https://confluence.atlassian.com/display/JIRA043/Velocity+Context+for+Email+Templates for more info.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.