Hi Nick,
Alexey is right this can be done without ScriptRunner. However if you want to use ScriptRunner so you can add some more customisation you could do something like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.security.roles.ProjectRoleActors
import com.atlassian.jira.security.roles.ProjectRoleManager
Issue issue = event.issue
def watcherManager = ComponentAccessor.getWatcherManager()
def roleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def projectRole = roleManager.getProjectRole("PM")
ProjectRoleActors actors = roleManager.getProjectRoleActors(projectRole,issue.getProjectObject())
def pms = actors.getUsers().toList()
pms.each{
watcherManager.startWatching(it, issue)
}
Add that code as a Script Listener and tell it to listen to the issue created event.
Thanks
Johnson Howard (Adaptavist)
Hello,
You can get this behaviour out of the box. If you add a watcher to an issue, this user gets notifications on issue events. You can add a new role and add the required user to this role. After it in the project notification scheme you can set for this role the same events as for watchers. In this case all users will get notifications like watchers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.