It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi,
I am implemented simple listener for PullEvent in Stash.
There are the following methods available: getRepository(), getDate(), getSource()
from pullEvent object.
Is it possible to get user's IP/Hostname who just took pull action?
Thank you in advance!
Michal
public class PullEventListener { @EventListener public void onPullEvent(RepositoryPullEvent pullEvent) { StashUser user = pullEvent.getUser(); Repository repository = pullEvent.getRepository(); Date date = pullEvent.getDate(); Source source = pull.getSource(); ... _mailService.submit( message ); } }
Try listening for a RequestStartedEvent instead.
This event has a
public RequestContext getRequestContext()
method. From the RequestContext object, you can get the raw request via
Object getRawRequest();
and cast the result down to a
RequestInfoProvider and from there call
String getRemoteAddress();
Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.