The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Listener to monitor large attachments

Filip Labarque
Contributor
December 2, 2019

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.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Ilya Turov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 3, 2019

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

Filip Labarque
Contributor
December 3, 2019

Thanks, in the mean time I've used:

user = AuthenticatedUserThreadLocal.get()

But I like your solution better. 

TAGS
AUG Leaders

Atlassian Community Events