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:
https://docs.atlassian.com/ConfluenceServer/javadoc/8.6.1/com/atlassian/confluence/impl/user/crowd/CachedCrowdUser.html#getCreatedDate()
I get users via the userAccessor so I have no idea what to do with this CachedCrowdUser =S
Any help appreciated. Thanks in advance.
BestStefan
Hi Stefan,
You can get the CachedCrowdUser object by using CrowdService.getUser method.
For example:
import com.atlassian.sal.api.component.ComponentLocatorimport com.atlassian.crowd.embedded.api.CrowdServiceimport com.atlassian.crowd.model.user.TimestampedUserdef crowdService = ComponentLocator.getComponent(CrowdService)def user = crowdService.getUser('admin') as TimestampedUseruser.getCreatedDate()
I hope this helps!
Kind regards,Helmy
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)
Forget this nonsense! Use Helmy's solution!
Hey @Helmy Ibrahim _Adaptavist_
that´s awesome. Thank you so much for your help.
It looks like you're new here. Sign in or register to get started.