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.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.