When I create new job, results of this job jenkins send on emails of all teams, but when we create test job(we can understand it by name of job), we should send email only to creator of job. It was so and it works:
pipe(..){
timeout(..){
BuildEmailExt email = new BuilEmailExt(this, Emails.allTeams())
someCode..
}
}
Then i add if:
pipe(..){
timeout(..){
if(env.JOB_NAME =~ /somePattern/){
BuildEmailExt email = new BuilEmailExt(this, SENDER)
}
else{
BuildEmailExt email = new BuilEmailExt(this, Emails.allTeams())
}
someCode..
}
}
And I get Exception : No such property email for class: WorkFlowScript What am I doing wrong?