I've searched for a means to obtain the id of the currently logged in User, but incredibly this info is not easily queried.
Existing solutions using User.current(), or Cause.UserIdCause() for triggered builds, are not reliable. User.current() results in SYSTEM whenever I try to use it. Cause.UserIdCause is only useful to me if I'm able to access it, and when I'm working with slaves it doesn't seem to be set for the master build triggered by a user.
Yet, while I'm hunting around, I can see that the user id is always displaying in the top right corner of the UI, taunting me since it is the information I want, but seemingly not available.
Surely this shouldn't be so hard or obtuse. If I just had the id, I could look up the User with a User.get(id) and be on my merry way.
Thanks.
- is blocked by
-
JENKINS-55245 User.current().getId() always return SYSTEM
- Closed