You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi there
I am new with Confluence ScriptRunner, and I'm a bit lost. I have to create a screen, when a user connects to Confluence, where he has to accept the Conditions of use.
I want to save the agreement as a user property, so I can later check who agreed and who didn't.
I couldn't find anything in Confluence about adding new properties/settings to the user.
Is there a way ? Did anybody do that ?
Thank you for your attention !
Pascal
So if some people are still interessted, the best solution is to use Bandana, that work with a context (could be global, a space key or a specific context for the properties you manage), a key (for me a string with the context name + user key + property version) and the value you want to store.
See Persistence in Confluence (atlassian.com) and What is Bandana? One form of Confluence persistence (atlassian.com)
Simple code:
import com.atlassian.bandana.BandanaManager
import com.atlassian.bandana.BandanaContext
import com.atlassian.confluence.setup.bandana.ConfluenceBandanaContext
String myContext = "<your context name>"
String myKey = "<your key>"
def myValue ="This could be text or a structure, an object ..."
ConfluenceBandanaContext ctx = new ConfluenceBandanaContext(myContext)
def bandanaManager = ComponentLocator.getomponent(BandanaManager)
// Store the value
bandanaManager.setValue(ctx, myKey, myValue);
//Retrieve the value
def myNewValue = bandanaManager.getValue(ctx, myKey)
but the data are anyway in the DB !
I don't get it ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.