Get notification only from priority change

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

1 answer

1 accepted

This widget could not be displayed.
Mizan Community Champion Jun 24, 2012

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 .

Mizan Community Champion Jun 24, 2012

try adding condition for project too . i dont know the correct sysntax but something like

issue.project?.name=='ABC'

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.

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.

Mizan Community Champion Jun 24, 2012

Where have you inserted this template ? It is very different from the template shown in the docs

You are mixing things: that code you pasted is velocity template, GStringTemplate is other beast, as explained in http://groovy.codehaus.org/Groovy+Templates

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

191 views 18 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you