I am looking at a way of manipulating a drop down with groovy script. For 
an example the credentials drop down under Source Code Management >GIT may 
have 5 to 10 credentials listed and we may want a specific credential ex: 
the 4th credential be selected. What is the way to achieve this.

The below code will show all the available credentials and if I add 
.set(4,0) this will show that the 4th credential is selected. However, on 
the drop down the default value "-none-" is shown and not the value I pass 
through the code.
















*return new StandardListBoxModel()                                    
.includeMatchingAs(                             project instanceof 
Queue.Task                                     ? 
Tasks.getAuthenticationOf((Queue.Task) 
project)                                     : 
ACL.SYSTEM,                             
project,                             
StandardUsernameCredentials.class,                             
GitURIRequirementsBuilder.fromUri(url).build(),                             
GitClient.CREDENTIALS_MATCHER).set(4,0)image*

<https://lh3.googleusercontent.com/-krvIncyg6w8/WJH241n5-wI/AAAAAAAAB3M/ZN9L6qSLrOkMyAfT5UkJ8p8zts0AcC4fgCLcB/s1600/credentials.png>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/8ef141c8-248b-46e4-9c01-eca37c10babd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to