Hi Community,
I know this from Jira where this can be done very easily with the following method:
user.getCreatedDate()
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.
Best
Stefan
Hi Stefan,
You can get the CachedCrowdUser object by using CrowdService.getUser method.
For example:
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.crowd.embedded.api.CrowdService
import com.atlassian.crowd.model.user.TimestampedUser
def crowdService = ComponentLocator.getComponent(CrowdService)
def user = crowdService.getUser('admin') as TimestampedUser
user.getCreatedDate()
I hope this helps!
Kind regards,
Helmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
docs.atlassian.com/atlassian-confluence/REST/6.2.1/#audit-getAuditRecords
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Forget this nonsense! Use Helmy's solution!
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.