-
Bug
-
Resolution: Not A Defect
-
Blocker
-
None
Hi,
I'm new to Jenkins and I'm trying to build a plugin. Are there any full working examples that show how to set/retrieve a username/password from Jenkins. I'm specifically referring to this https://github.com/jenkinsci/credentials-plugin/blob/master/docs/consumer.adoc
public ListBoxModel doFillCredentialsIdItems( @AncestorInPath Item item, @QueryParameter String credentialsId, ... (1) ) { StandardListBoxModel result = new StandardListBoxModel(); if (item == null) { if (!Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)) { return result.includeCurrentValue(credentialsId); (2) } } else { if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { return result.includeCurrentValue(credentialsId); (2) } } return result .includeEmptySelection() (3) .includeMatchingAs(...) (4) .includeCurrentValue(credentialsId); (5) }
I'm getting stuck at step 4 in the example, what should I do here? I've tried looking at the other plugins to see how they implement this but I'm get lost quickly. Is there a simple demo that shows how this works?