Hello All,
I have used below script in script listeners to disable autowatcher for reporters for a particular project.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.preferences.PreferenceKeys
def userManager = ComponentAccessor.getUserManager()
def preferencesManager = ComponentAccessor.getUserPreferencesManager()
userManager.getUsers().each {
user ->;
if (! preferencesManager.getPreferences(user).getBoolean(PreferenceKeys.USER_AUTOWATCH_DISABLED)) {
preferencesManager.getPreferences(user).setBoolean(PreferenceKeys.USER_AUTOWATCH_DISABLED, true)
}
}
But it is disabling for all the projects. when user creating issues in other project they are not automatically added to the watcher field.
Is it possible to limit disabling autowatcher for reporters for a single project??
Thanks in Advance,
Manikanta