public static Credentials lookupSystemCredentials ( String credentialsId ) { return firstOrNull ( lookupCredentials ( Credentials . class , Jenkins . getInstance ( ) , ACL . SYSTEM , emptyList ( ) ) , withId ( credentialsId ) ) ; }
Util method to find credential by id in jenkins