History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2920
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robin Shen
Reporter: Phong Trinh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Get Current logged in User

Created: 09/Mar/17 01:28 AM   Updated: 17/Mar/17 11:21 PM
Component/s: None
Affects Version/s: 6.1.36
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows


 Description  « Hide
 Hi Robin and Support Team,
  Is there any way I can get my current logged in user via groovy or powershell script?

  Thanks
ptrinh

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [09/Mar/17 01:57 AM]
Just call "user" in your groovy script. If you want to use this variable from Powershell script, you will need to pass it as environment variable, say:
env var name: QB_USER
env var value: ${user.name}

Phong Trinh [17/Mar/17 02:24 AM]
 Hi Robin,
 
  May I get the user name (Trigger By) that triggers a build? It is triggered by schedule most of the time, but sometimes it is triggered by an user.

 Thanks,
ptrinh

Robin Shen [17/Mar/17 11:21 PM]
In that case, please call build.getRequester(). This value will be null if the build is run via schedule.