I wrote a pipeline in DSL where I have variables as:
def mailidlist ="${mailid}"
def bemailidlist="${BEmailid}"
def pmailidlists = "${Pmailidlist}"
Then I am using same variables in property/parameters:
properties([
parameters([
gitParameter(branch: '', branchFilter: 'origin/(.*)', description: 'Provide the ...', name: 'sourceBranchName', quickFilterEnabled: false, selectedValue: 'NONE', sortMode: 'NONE', tagFilter: '*', type: 'PT_BRANCH'),
choice(choices: ['dev'], description: 'DEV', name: 'deploymentEnv'),
text(description: 'Provide Email Address of the product owner to be notified', name: 'PmailidList'),
text(description: 'Provide Email Address of the people to be notified', name: 'mailid'),
text(description: 'Provide Email Address of the peoplefor B Failures', name: 'BEmailid'),
])
])
Now while calling the function under node windows node , I would call without any arguments:
node(windowsNode) {
nslookup()
createmailerlist()
}
Below is the function definition for createmailerlist() function:
<pre lang="Groovy">void createmailerlist() {
echo mailidlist
stage('Generate mail List ') {
if(!((currentBuild.result).contains('UNSTABLE'))) {
mailidlist = mailidlist + ";" + pmailidlists
}
echo 'Notify to users - '+ mailidlist
}
}
But it does not executes and throws error as :
[Checks API] No suitable checks publisher found.
java.lang.NoSuchMethodError: No such DSL method 'createEmailList' found among steps
[ArtifactoryGradleBuild, MavenDescriptorStep, addBadge, addEmbeddableBadgeConfiguration,
addErrorBadge, addHtmlBadge, addInfoBadge, addInteractivePromotion, addShortText,
addWarningBadge, ansiColor, ansiblePlaybook ....
What I have tried:
I also tried to define the function with arguments but still no luck :
void createEmailList(String mailidlist,String pmailidlists)