Using a trivial Pipeline project, we are seeing differing credential behavior with `Run As Specific User` vs `Run As User who Triggered Build` using User Private credentials (https://<server>/user/<user>/credentials/store/user/domain/_/).
Here is the code for the Pipeline. This is configured inline in the Pipeline Job.
In the Pipeline above `user-private-credential` is defined for the user executing the script.
When the Authorization mode is set to "Run As Specific Build", the script is able to successfully retrieve the user's credentials.
If the Authorization mode is set to "Run As User who Triggered Build", then the pipeline is unable to retrieve the credentials.
The desired behavior is to be able to retrieve the credentials in both cases.