Hi,
I've created a listener in Scriptrunner for Confluence to monitor the upload of large attachments. I can get the attachment info (name, type, size) but how can I get the info on who uploaded the attachment (username, email)?
I'm using the AttachmentCreateEvent.
I guess you can get list of attachments from the event (or a single attachment) and then look for those attachments creator(s).
I believe attachment's creator would be same person as the user who uploaded it.
event.attachment
would return you an Attachment object, then you can get the ConfluenceUser object from it by doing
attachment.creator
and user then has (full)name and email fields you can access. well, it's all in the docs
Thanks, in the mean time I've used:
user = AuthenticatedUserThreadLocal.get()
But I like your solution better.
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.