[Solved] Error: Scripts not permitted to use staticMethod hudson.util.Secret fromString java.lang.String in Jenkins

While importing the test results in QMetry using the Jenkins Pipeline, the user may face an error “Scripts not permitted to use staticMethod hudson.util.Secret fromString java.lang.String“ in the console logs as shown below.

This is specifically related to Jenkins. The Pipeline script above will not execute until an Administrator approves the method signature via the In-process Script Approval page. Below are the steps for approving the pipeline script. (These steps has to be performed by the Admin user only)

  • Go to Manage Jenkins >> In process Script Approval

 

  • Click on the Approve button.

Once the pipeline script is approved by the Administrator, the user can upload the test result files in QMetry from Jenkins Pipeline. Refer to this help link from Jenkins for more details.