You can pass the Jenkins instance as the context.

Jenkins.get()

On Thu, 23 Jul 2020 at 13:51, Michael Carter <[email protected]>
wrote:

> The situation in a nut shell.   I've got a validation behind a button that
> calls a REST service to do the validation.   So the validation is happening
> outside any running job.
>
> The only code I can find to lookup the password for the REST call is this
> one.
>
>     StandardCredentials credResult = CredentialsProvider.
> findCredentialById(secretId,
>
>   StandardCredentials.class,
>
>   run,
>
>   Collections.<DomainRequirement>emptyList());
>
>
> The run parameter can't be null.   So how do I create a dummy run job
> inside a Jenkins Plugin.   Or better yet create some type of run object
> that tells where it was running because I'd love to be able to track who's
> running the command against the credential.  (side project in another place)
>
> --
> 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/61b1eb70-c200-4e7a-9a58-7849c2ef74ado%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/61b1eb70-c200-4e7a-9a58-7849c2ef74ado%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAH-3Bic1PZPCmrv84YFZvkgMdnEnUaWL0rHnFF_Y6%3DF9iJVupQ%40mail.gmail.com.

Reply via email to