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

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3c34962d-c86f-43dd-a19c-778bab8d2a33%40googlegroups.com.

Reply via email to