I would like to programmatically assign a user to watch a page in my Confluence instance using the Java API. I suspect I need to implement the addNotification() method from the DefaultNotificationManager Class. However, when ever I try, I get "Target exception: java.lang.NullPointerException".
Can someone provide an example? Thx!
Community moderators have prevented the ability to post new answers.
As page favourites are representet as labels internally, you need to add a personal label like this:
Label favouriteLabel = new Label(LabelManager.FAVOURITE_LABEL, Namespace.PERSONAL, user); labelManager.addLabel(page, favouriteLabel);
best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I've seen the tutorial to create a Notifcation plug-in. That's really not what I'm trying to do. I'm using this plug-in to script interactions using Beanshell. I've had success programmatically creating new pages. Now I want to assign users as "Watchers" of those new pages. Since I'm using Beanshell, I was hoping I could find a path forward in the Java docs. Can you point me to a Class that can make a user a Watch a page?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you read the documentation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.