[JIRA] (JENKINS-59628) Retrieve currently logged-in user from shared library programmatically

10 views
Skip to first unread message

benjamin.muschko@gmail.com (JIRA)

unread,
Oct 2, 2019, 12:08:12 PM10/2/19
to jenkinsc...@googlegroups.com
Benjamin Muschko updated an issue
 
Jenkins / Improvement JENKINS-59628
Retrieve currently logged-in user from shared library programmatically
Change By: Benjamin Muschko
Summary: Retrieve currently logged-in user from shared library programmatically
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

benjamin.muschko@gmail.com (JIRA)

unread,
Oct 2, 2019, 12:10:15 PM10/2/19
to jenkinsc...@googlegroups.com
Benjamin Muschko updated an issue
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.??

That 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 ' s fine but obviously 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?

m.winter@sap.com (JIRA)

unread,
Jan 30, 2020, 4:36:02 AM1/30/20
to jenkinsc...@googlegroups.com
Markus Winter commented on Improvement JENKINS-59628
 
Re: Retrieve currently logged-in user from shared library programmatically

As already mentioned in the other tickets there is no user associated with a build when it was triggered by an scm poll or by a schedule or a github event.

And when you say logged-in user, which one you mean when you have more than one user accessing your Jenkins at the same time?

And when you use the REST API you need to authenticate probably for which you have to provide a user. And then it will return exactly this user as the logged in user.

The only use case I see is when you have a pipeline step waiting for user input. But then when a user clicks on a button you have a http request with a user.

 

benjamin.muschko@gmail.com (JIRA)

unread,
Jan 30, 2020, 10:04:03 AM1/30/20
to jenkinsc...@googlegroups.com

The use case I am thinking of is the one you mentioned around a manual user input. You are correct, you can retrieve this via "submitterParameter". You can close the issue.

benjamin.muschko@gmail.com (JIRA)

unread,
Jan 30, 2020, 10:04:04 AM1/30/20
to jenkinsc...@googlegroups.com

benjamin.muschko@gmail.com (JIRA)

unread,
Jan 30, 2020, 10:05:02 AM1/30/20
to jenkinsc...@googlegroups.com
Change By: Benjamin Muschko
Status: Fixed but Unreleased Resolved
Resolution: Not A Defect Won't Fix
Reply all
Reply to author
Forward
0 new messages