Forums

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

ScriptRunner - How to get a user name from GroupMembershipCreatedEvent event?

Paul September 27, 2018

Hi,

When a user is added to a group, it can be caught by GroupMembershipCreatedEvent.

How can I find out which user (name/ID) has been added to the group?

Of course I can get all the users from the group in question (ComponentAccessor.groupManager.getGroup("group_name") but I need to find just the added user.

Thanks,
Paul

1 answer

1 accepted

0 votes
Answer accepted
Matthias Gaiser _K15t_
Community Champion
September 27, 2018

Hi Paul,

I haven't tested this myself, but based on the javadocs about the GroupMembershipCreatedEvent, I would guess, you have to call the method getEntityName() on the event.

Cheers,
Matthias.

Paul October 1, 2018

Thanks Matthias, that was it <facepalm>.

Suggest an answer

Log in or Sign up to answer