Receiving notifications when a user from a particular group creates a ticket

Hi everyone, we're looking for a way to have a user notified whenever a particular user (or user from a particular group) opens up a ticket in any project. So basically the second one of those users creates a ticket, this master user will get an email notification informing them of the creation.

I'm familiar with some of the reporting features, such as creating a filter for these user's issues and sending a report out every night, but it doesn't look like that's what we're looking for. I'd prefer to do this without any paid plugins if possible, as getting those things approved for purchase is kind of difficult.

1 answer

This widget could not be displayed.

I've done this with a custom listener; first I created a custom event, then I used the script runner listener for firing the event when a criteria was met, with the criteria being that the user was a member of the group.  Then I added a notification for that event using the "issue updated" email template.

More streamlined would be to just emit a custom email and bypass the custom event, but then you'll need to write your own email template.  There are pros and cons to both approaches; in this case, since you want it for all projects, you probably don't want the event as then you need to trust that every notification scheme will maintain the correct notification.

Are there any tutorials for writing listeners?

You wouldn't have to write this one, beyond the condition.  The interface provides examples, I'll take a look and see if this is one of them.

For both "Fires an event when condition is true" and "Send a custom email", built-in listeners, there is a sample condition for "Reporter is in a particular group":


import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()
groupManager.isUserInGroup(issue.reporter?.name, 'business-users')


So (as a JIRA admin) you'd go to Administration / Add-ons, then "Script Listeners" underneath "SCRIPT RUNNER" along the left.  Then "send a custom email", project key "All Projects", Events "Issue Created", Condition as described above, adjusting for your group name, then provide an email template and a subject template.  Something like:

Subject:

Issue: $issue.key  opened by user/group X

Email:

Issue: $issue.key  opened by user/group X

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

143 views 1 4
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