I have requirement to get logged user id information into Jenkins plugins.
I have created HelloWorldclass which extend hudson.tasks.Builder class for creating plugin. From this class, I am trying to get logged user in perform method.
I have tried various option but could not get logged user, every options return SYSTEM as user id.
User.current() :- Return SYSTEM on Jenkins console but on jenkins script console gives me perfect result but same code does not have me logged user information.
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.
Can anybody help to solve this problem.