如何在Groovy参数中获取Jenkins中的当前会话用户 [英] How to get the current session user in Jenkins on a Groovy parameter
本文介绍了如何在Groovy参数中获取Jenkins中的当前会话用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在Jenkins中获取当前登录用户,我正在使用Groovy参数,但我不知道如何获取它,
I need get the current log in user in Jenkins, I am using a Groovy parameter but I don't know how to get that,
谢谢,
推荐答案
您应该可以打电话给您:
You should be able to call:
import hudson.model.User
...
User.current()
从groovy脚本获取当前用户: - )
From a groovy script to get the current user :-)
这篇关于如何在Groovy参数中获取Jenkins中的当前会话用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文