My colleague pointed me in.
The trick is to iterate over all CredentialsProvider and filter by id:
@Field
def privateToken = CredentialsProvider
.lookupCredentials(StandardCredentials, (Item) null, ACL.SYSTEM)
.find { it.id == "gitlab-api" }
.apiToken
Am Freitag, 15. Mä
Hello,
I'm currently programming a Seed Job that requests via REST API a list of
repositories from a Gitlab instance. I want to iterate this list and create
a pipeline job for each repository. My idea is to use Gitlab plugin and
Credential Plugin for storing the API token and the Job DSL plugin