How to get custom api tokens

14 views
Skip to first unread message

rajesh pilla

unread,
May 21, 2020, 11:13:45 AM5/21/20
to Jenkins Users
I am trying to generate tokens for different use-cases and I am looking for a way to get token value by using token name. Can anyone help me with this?
I am able to get legacy token with  below script, want to achieve the same to get other token values.

user = hudson.model.User.get('admin')
prop = user.getProperty(jenkins.security.ApiTokenProperty.class)
println(prop.getApiTokenInsecure())


Thanks in advance
Reply all
Reply to author
Forward
0 new messages