Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14605

Simple means to obtain logged in user's id

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Major Major
    • core

      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.

            Unassigned Unassigned
            dankirkd Daniel Kirkdorffer
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: