Jenkins-client0.3.7 jar offbytwo.jenkins.JenkinsServer param value with comma(,) is not passing properly

19 Views Asked by At

I have job create in jenkins to build the code and deploy to server , the parameter supposed to be as below and I have triggered the job through java code , the job is success full HashMap<String, String> parms = new HashMap<String, String>();

// QUOTE,SERVICING,SUBMISSION,WORKITEM,RENEWAL

    

    parms.put("databaseName", "WORKITEM,SUBMISSION");

but the parameter values didint pass to server its empty

But when pass one param value , its working and able to see the paramvalue in the jenkins , can you help on this

parms.put("databaseName", "WORKITEM");

code

String url  ="https://server/job/gi-underwriting/job/SCUP-6225/job/dev-ci-cd/job/dev/job/data/job/dml/";

     
     
  String jobName ="ci-cd-pipeline";
    HashMap<String, String> parms = new HashMap<String, String>();
    
// QUOTE,SERVICING,SUBMISSION,WORKITEM,RENEWAL
    
    parms.put("databaseName", "WORKITEM,SUBMISSION");
  //  parms.put("databaseName", "SUBMISSION");
  
  JenkinsServer jenkins = new JenkinsServer(new URI(url), "usernam", "token");


   
      JenkinsTriggerHelper triggerHelper = new JenkinsTriggerHelper(jenkins); 
      
      BuildWithDetails details =      triggerHelper.triggerJobAndWaitUntilFinished(jobName, parms);
 if (details!=null) 
      System.out.println("LOGS " +  details.getConsoleOutputText()); 
 else 
      System.out.println("details not found " ); }
 catch (Exception e)
        { 
          e.printStackTrace(); 
        }
     
 
 
 
 return "";

}

The build is triggering in jenkins , when i check non of the github is picked and checked the  parameter is passed are empty databaseName, please let me know what is missing here and what i need to modify ,expectation is the parameter value should have databaseName WORKITEM,RENEWAL , when i send only one param its working fine parms.put("databaseName", "SUBMISSION"); ,the job is building and respective github code is compiling and deploying 
0

There are 0 best solutions below