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
Hi Jordan,
If you’re sure you want to use Velocity, check out the User Guide for Velocity 1.6, but the changes you make to these templates will only affect notifications that are sent from non-JSD projects.
JSD has used its own notification system since version 3.3 (JIRA 7.3), in which there’s no template variable with the full comment history for an issue. If turning off quote stripping (Administration > Email requests > Strip quotes) doesn’t help, please raise a support request so we can look into it further.
I see. I have raised a support request. But just to be clear, the JSD notification are only sent and configured for customers, correct?
If I were assigned a ticket, and a colleague that was an agent, and a developer on the project replied, then would those notifications go through the Velocity files?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.