Hi All,
one of my project lead asked for getting email notifcations when a user change the priority on an issue in his project.
Now only the Current assignees get email from Issue Updated event.
I know that we can just add the project lead to the Issue Updated event but can it be made that he gets email ONLY about changing the Priority fields? So other updates (e.g. custom fields, etc.) would not trigger email for him?
Can it be done?
Thanks!
Rumi
This can be done by a listener , you will have to create a listener( plugin) which will check the change in an issue, if the priority has changed then it will trigger an event then based on this even send an email to the project lead .
There is a similar script available with the script runner plugin but it sends email on some condition .
try adding condition for project too . i dont know the correct sysntax but something like
issue.project?.name=='ABC'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mizan,
yes, I found the built-in script "Send a custom email" but here cannot be restrict the project:
issue.priority?.name == 'Major' && changeItems.any { it.get('field')=='priority' }
It would trigger emails from all the 200 projects we have.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
I instered an email template:
#parse("templates/email/includes/issueplugins.vm") [ ${baseurl}/browse/${issue.getKey()}?page=${tabpanel-all} ] #if($remoteUser.fullName) $i18n.getText("template.change.updated", $remoteUser.fullName, $issue.getKey()) #dashes($!remoteUser.fullName)---------#dashes(${issue.getKey()})- #end #changesIncludingStatus([]) #comment() #visibility() #parse("templates/email/text/includes/issuesummary.vm") #parse("templates/email/text/includes/footer.vm")
When I made a preview, I got the following error message: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript4.groovy: 6: illegal string body character after dollar sign; solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 6, column 73. $remoteUser.fullName, $issue.getKey()) ^ 1 error
What I don't understand because I don't really know this scripting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where have you inserted this template ? It is very different from the template shown in the docs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are mixing things: that code you pasted is velocity template, GStringTemplate is other beast, as explained in http://groovy.codehaus.org/Groovy+Templates
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.