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
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
I know this from Jira where this can be done very easily with the following method:
Does anyone know a comparable way to achieve this in Confluence?
I found the following but I couldn´t figure out how/where to implement:
I get users via the userAccessor so I have no idea what to do with this CachedCrowdUser =S
Any help appreciated. Thanks in advance.
You can get the CachedCrowdUser object by using CrowdService.getUser method.
def crowdService = ComponentLocator.getComponent(CrowdService)
def user = crowdService.getUser('admin') as TimestampedUser
I hope this helps!
I don't have a solution for the JAVA-side of things but maybe this REST solution can prove useful or at least point you in a helpful direction?
The /audit endpoint allows you to review activity related to your instance, including when users are synched from AD, say to the "confluence-users" group, or when created manually.
Basically, you'd call the audit endpoint, get a list of records (optionally you can specify a timeframe), parse each record to determine if the "summary" = "User created", then capture the "creationDate" property.
Maybe for JAVA, start here?
com.atlassian.confluence.audit (Atlassian Confluence 8.6.1 API)