How can I change the Micro Focus ALM password in my jobs programmatically?

Article ID:360028553272
2 minute readKnowledge base


  • The Micro Focus Application Automation Tools does not allow you to use global credentials, thus, you need to enter them in every single job using it. Changing the password programmatically could cover the use case where the server password changes.


One potential approach is to run the script shown below from the Script Console in your controller instance:

Manage Jenkins->Script Console

Important Notice: This script is intended to perform changes in your jobs configuration, thus it is highly recommended to be sure that we have a working backup for the jobs that we are going to update.

def projects= hudson.model.Hudson.instance
def new_password="New value to set"
def DRY_run=true
//Set jobName="" to ignore jobName filtering
def jobName="test_job"


  //We can filter by job name. Comment the corresponding lines to apply the changes to every job
  if (it.getFullName()==jobName || jobName==""){
  //We iterate over different jobs and select the ones using the corresponding builder{ builder -> builder instanceof

 /*We need to create a new instance class but recovering every value from the existing class except for the password which we
  pass as parameter
      RunFromAlmBuilder new_builder = new  RunFromAlmBuilder( builder.almServerName,
            builder.almRunHost, builder.isFilterTestsEnabled,builder.filterTestsModel)

     //We remove the existing values
     //We add the new ones
     //We save the job
     println "The job "+ it.getFullName() + (DRY_run?" was not changed as this was a test run":" was updated successfully!").toString()



You can configure the script changing the values for the variables below:

  • Set the DRY_run variable to false when you want the script to change the password.

  • If you set JobName variable to "" the script will go over every job using ALM.

  • If you want to change only one job, please provide the full project name in JobName variable.

Another potential approach is to take advantage of your Operations Center, and create a cluster operation to run the above described Groovy script in different controllers (Client controllers or Managed controllers). But essentially, the outcome would be the same.