How to use if conditionals under stages in DSL pipeline
by parpande from LinuxQuestions.org on (#5EN4H)
I want to call a function under my pipeline , the function name is CMList and the arguments eList and pLists are in the format of email address .
Quote:
Below are the choice parameter added , so that the entries appear in the Jenkins UI and value needs to be input for both
eList and pLists .
Quote:
Below snippet describes the function call:
Quote:
The function CMList is defined as below:
Quote:
I want to create a function as CMList that consists of a stage in groovy . But this function throws the error as:
Quote:


Quote:
def eList ="${emailAddress}" def pLists = "${POEmailList}" |
Below are the choice parameter added , so that the entries appear in the Jenkins UI and value needs to be input for both
eList and pLists .
Quote:
properties([ parameters([ text(description: 'Provide Email Address of the PO ', name: 'POEmailList'), text(description: 'Provide Email Address of the people to be notified', name: 'emailAddress'), ]) ]) |
Below snippet describes the function call:
Quote:
node(windowsNode) { nslookup() CMList() // Calling CMList function under `windowsnode`. } |
The function CMList is defined as below:
Quote:
void CMList(String eList,String pLists) stage('Generate Email List To Be Notified') { if(!((currentBuild.currentresult).contains('UNSTABLE'))){ eList = eList + ";" + pLists } echo 'Notify to users - '+ eList } |
I want to create a function as CMList that consists of a stage in groovy . But this function throws the error as:
Quote:
'No such DSL method 'createEmailList' found among steps [ArtifactoryGradleBuild, MavenDescriptorStep, addBadge'.... |