My role has changed. Hundreds of pages I was watching are now no longer relevant for me. I want to be able to do mass unwatch, rather than one by one. Or simply wipe the slate clean and unwatch all.
An alternative would be to unwatch all pages in a particular space, thus I could go through the spaces more quickly than through all the separate pages.
Any suggestions? Do I need to raise a suggestion?
Confluence 5.8
this code help me
import
com.atlassian.confluence.mail.notification.NotificationManager
import
com.atlassian.spring.container.ContainerManager
import
com.atlassian.sal.api.component.ComponentLocator
import
com.atlassian.confluence.pages.PageManager
import
com.atlassian.confluence.search.service.ContentTypeEnum
import
org.slf4j.Logger
import
org.slf4j.LoggerFactory
import
com.atlassian.confluence.user.UserAccessor
import
com.atlassian.confluence.spaces.SpaceManager
import
com.atlassian.user.UserManager
Logger log = LoggerFactory.getLogger(
"console"
)
def userManager = ComponentLocator.getComponent(UserManager)
NotificationManager nm = ( NotificationManager) ContainerManager.getComponent("notificationManager"
)
PageManager pageManager = ComponentLocator.getComponent(PageManager)
ContentTypeEnum ctp = ComponentLocator.getComponent(ContentTypeEnum)
UserAccessor userAccessor = ComponentLocator.getComponent(UserAccessor)
def spaceManager = ComponentLocator.getComponent(SpaceManager)
def users = userManager.users.find{it.getName() ==
"username"
}
def nfu = nm.getNotificationsByUser(userAccessor.getUserByName(users?.getName()))
nm.removeAllNotificationsForUser(userAccessor.getUserByName(users.getName()))
return
nm.getNotificationsByUser(userAccessor.getUserByName(users.getName()))
Hi Richard,
Check out this question and answers.
https://answers.atlassian.com/questions/33993
Regards,
Dave
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.