[JIRA] (JENKINS-56509) Retrieving a username/password credential
Title: Message Title Carl Bourne closed an issue as Not A Defect Asked question in Jenkins mailing lists. Jenkins / JENKINS-56509 Retrieving a username/password credential Change By: Carl Bourne Status: Open Closed Resolution: Not A Defect Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-56509) Retrieving a username/password credential
Title: Message Title Carl Bourne updated an issue Jenkins / JENKINS-56509 Retrieving a username/password credential Change By: Carl Bourne 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]{code:java}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)}{code}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 getting how this works? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
[JIRA] (JENKINS-56509) Retrieving a username/password credential
Title: Message Title Carl Bourne created an issue Jenkins / JENKINS-56509 Retrieving a username/password credential Issue Type: Bug Assignee: Unassigned Components: core, credentials-plugin Created: 2019-03-11 21:08 Priority: Blocker Reporter: Carl Bourne Hi, 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'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 getting