Hi community,
Can anyone please share a code snippet for a confluence REST EndPoint that adds a given user as a watcher on a given page/content?
I've been struggling with the existing documentation and API but couldn't get to a solution...
Any contribution would be welcomed!
Thanks a lot,Tanya
Answering to myself :-)
For string parameters: user, pageId
import com.atlassian.confluence.mail.notification.NotificationManagerimport bucket.user.UserAccessorimport com.atlassian.confluence.pages.Pageimport com.atlassian.confluence.pages.PageManagerdef notificationManager = (NotificationManager) ContainerManager.getComponent('notificationManager')def userName = userAccessor.getUser(user)Page page = pageManager.getPage(pageId)def content = page?.getContentEntityObject() notificationManager.addContentNotification(userName, content)
It looks like you're new here. Sign in or register to get started.