I am trying to make it so users can do quick commenting via email, but to do that, I would like all previous comments to show up in the notification emails. I was somehow able to get this to work Friday, but am unable to replicate it. I am modifying the velocity template files that deal with the issuecommented and issueupdated events. Whenever I change them, the system doesn't change the email as expected, and just uses the JSD notification templates instead. As I mentioned, I tried this on Friday, and accidentally did it on Prod (whoops) but even though it worked as expected, I deleted it. The only difference between my Prod and Dev instances are the versions. Prod is 7.4.0 and Dev is 7.7.1
I am not married to the idea of doing this with Velocity templates, and I am fine with doing it with the HTML templates built into JSD, if possible
Here is the code I have changed my issueupdated and issuecommented velocity templates to:
#set ($componentAccessor = $constantsManager.getClass().forName('com.atlassian.jira.component.ComponentAccessor').newInstance())
#set ($commentManager = $componentAccessor.getCommentManager() )
##For Each loop which runs backwards through the issues (youngest to oldest)
#set ($comments = $commentManager.getComments($issue))
#set ($c = $comments.size())
#foreach($comment in $commentManager.getComments($issue))
#set ($c = $c - 1)
## If statement filters out comments with a RoleLevel other than "all users"
#if(!$comments.get($c).getRoleLevel())
- - - - - - - - - - -
$comments.get($c).getCreated() - $comments.get($c).getAuthorFullName()
$comments.get($c).getBody()
#end
#end
Side Question: Is there a good site I can go to to learn some of this code? I have googled a bit, but didnt find anything great
Edit: After more testing, I have noticed that this works when the user comments internally, but not publicly