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

Retrieve currently logged-in user from shared library programmatically

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • core, pipeline
    • None
    • Jenkins ver. 2.150.2

      I am trying to determine the currently logged-in user from a shared library programmatically via the API. Other users reported the same issue in other tickets but all of them have been closed without giving additional guidance.

      https://issues.jenkins-ci.org/browse/JENKINS-14605
      https://issues.jenkins-ci.org/browse/JENKINS-55245

      The closing reason has been:

      Remember that these methods are generally only meaningful within the dynamic scope of an HTTP request or CLI command. Use the dev mailing list or IRC if you still have issues.

      Having to call the REST API from a shared library is extremely backwards and cumbersome. You will also have to know the Jenkins URL which you'll likely have to pass into the shared library.

      Obviously the other users asked how to make this happen from pipeline code. Can you clarify if this is possible right now and provide a working example? If it is not possible right now, are you planning to work on a fix?

            Unassigned Unassigned
            bmuchko Benjamin Muschko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: